Test name | Executions per second |
---|---|
RegEx.test | 13898367.0 Ops/sec |
Array.includes | 14863528.0 Ops/sec |
var appState = "active";
var regex = /inactive|background|other|another/;
var arr = ['inactive', 'background', 'other', 'another'];
regex.test(appState);
arr.includes(appState);