two some VS for if find (v3)

Revision 3 of this benchmark created on


Setup

const releaseNoteVersions = ["1.31.2","1.31.3","1.31.4","1.31.5", "1.32.1"];
const openedReleaseNoteVersions = ["1.30.1","1.30.2","1.31.1","1.32.1"];

Test runner

Ready to run.

Testing in
TestOps/sec
juju
 const func = ()=>{if (!openedReleaseNoteVersions.length) {
    return true;
  }

  return releaseNoteVersions.some((releaseNote) =>
    !openedReleaseNoteVersions.some(release => release === releaseNote));
    }
func();
ready
loulou
const func=()=>{if (!openedReleaseNoteVersions.length) {
    return true;
  }

  for (const releaseNote of releaseNoteVersions) {
    if (!openedReleaseNoteVersions.find(release => release === releaseNote)) {
      return true;
    }
  };
  return false;
 }
func();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.