三元运算符 (v5)

Revision 5 of this benchmark created on


Preparation HTML

<script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

</script>

Test runner

Ready to run.

Testing in
TestOps/sec
? :
<script>
for(var i = 0;i < 100000;i++){
a?i:i+2
}
</script>
ready
if
<script>
for(var i = 0;i < 100000;i++){
if(a){
a = i
}else{
a = i+2
}
}
</script>
ready

Revisions

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