Run details:
Mozilla/5.0 (Mobile; LYF/F120B/LYF-F120B-001-02-34-170919-i;Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5
Firefox Mobile 48
Firefox OS
Mobile
3 years ago
Test name Executions per second
1 4.4 Ops/sec
2 4.7 Ops/sec
3 3.9 Ops/sec
Tests:
  • 1

    AخA
     
    var test = function test() {
        var x = 0;
        var nested= function() {
            for (var i=0; i< 1000000; i++) {
                x = x + Math.random();
            }
        }
        nested();
    };
    test();
  • 2

     
    (function () {
        var x = 0;
        var nested= function() {
            for (var i=0; i< 1000000; i++) {
                x = x + Math.random();
            }
        }
        nested();
    })();
  • 3

     
    (function test() {
        var x = 0;
        var nested= function() {
            for (var i=0; i< 1000000; i++) {
                x = x + Math.random();
            }
        }
        nested();
    })();