1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var start, end, i;
//var x = 9;
i = 1000000;
start = new Date().getTime();
while (i--) {
    if (typeof x == "undefined")
        /* nothing */ ;
}
end = new Date().getTime();
console.log('if (typeof x == "undefined")', end - start);

i = 1000000;
start = new Date().getTime();
while (i--) {
    if (typeof x == undefined)
        /* nothing */ ;
}
end = new Date().getTime();
console.log('if (typeof x == undefined)', end - start);