'use strict';
var arr = ['Bart', 'Lisa', 'Adam'];
var len = arr.length-1;
while(len> =0){
alert('Hello,' arr[len]);
len--;
}//This will pop up normally, and it will stop after popping up after 3 times.
'use strict';
var arr = ['Bart', 'Lisa', 'Adam'];
var len = arr.length-1;
while(len= >0){
alert('Hello,' arr[len]);
len--;
}//After 3 normal pop-ups, many Hellos will pop up, undefined , and then the browser crashes.
Why is this happening?
I’m on my knees...
>=
是大于等于运算符,=>
那是ES6的箭头函数操作符啊,而且你还加了'use strict'
, the proper native ES6 has started...Arrow function
The problem with JS parsing, => is the arrow function
Being hit by the perfect hit I mentioned before, it’s hard to tell whether it’s >=, <=, =>, =<
There are still so many tricks in js, and I accidentally forget that I am writing code