dgfgghfghfghghgfhgfhfghfhgfh

Benchmark created by cc on


Preparation HTML

<script>
var ar = [1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, '55', 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9, 9, 2, 3, 4, 5, 6, 7, 8, 9];
function cc5(a,b,c){
 c=a.length;
 while(c!=-1&&b!=a[--c]);
 //while(c>-1&&b!=a[--c]);
 //while(--c!=-1&&b!=a[c]);
 return c
}
function cc3(a,b,c,d,e){//value,array,placeholder
 for(d=0,c=a.length,e=false;d<c;b!=a[d++]||(e=true,d=c));
 return e
}
function cc4(a,b,c,d){//value,array,placeholder
 for(
  d=0,c=a.length;
  d<c;//console.log(d),
  b!=a[d++]||(d=c+1)
 );
 return (a,d,c,d)
}

function cc6(a,b,c){
 c=a.length;
 //while(c!=-1&&b!=a[--c]);
 //while(c>-1&&b!=a[--c]);
 while(!(b==a[--c]||c<0));
 //while(--c!=-1&&b!=a[c]);
 return c
}
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
indexOf
ar.indexOf('55')!==-1
ready
lastIndexOf
ar.lastIndexOf('55')!==-1
ready
cc5
cc5(ar,55)
ready
cc6
cc6(ar,55)
ready

Revisions

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