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