For..in vs [""] test

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
test
var t = { name: "testName", pass: "testPass"}; 
var checkFor = ["name", "pass"];

for (var i = 0; i < checkFor.length; i++) {
  if (!t[checkFor[i]]) break;
}
ready
for..in
var t = { name: "testName", pass: "testPass"}; 
var checkFor = ["name", "pass"];

for (var property in t) {
  if (checkFor.indexOf(property) == -1) break;
}
ready

Revisions

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