我花了几个小时,只是找出我拼错字.length
作为.lenght
.它可以正常运行,完全没有警告.为什么...?
我'use strict'
在Node.js 10.13.0上使用并运行.
码:
'use strict';
let arr = [1, 2, 3, 4];
for(let i = 0; i < arr.lenght; i++) {
console.log(arr[i]);
}
Run Code Online (Sandbox Code Playgroud)
javascript ×1