Array.includes vs OR statement (v6)

Revision 6 publishedon

Setup

const status = 401;

const badStatusCodes = [401,403,404];

Test Runner

Initializing...

Testing in
Test CaseOps/sec
Array.includes
if (badStatusCodes.includes(status)) {
  void 0;
}
ready
OR Statement
if (
  status === 401 ||
  status === 403 ||
  status === 404
) {
  void 0;
}
ready

Revisions

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

Revision 1
publishedon
Revision 6
publishedon