Tianhe Gao

js-debugging

```js console.log() console.clear() console.log(typeof var) 变量名拼写错误 丢失的括号 单双引号混用,`\`来帮忙 本应用 `==` 却错为 `=` 函数调用不加 `()` 函数调用时,多个参数传递的次序错乱 Off by one errors (sometimes called OBOE) crop up when you're trying to target a specific index of a string or array (to slice or access a segment), or when looping over the indices of them. JavaScript indexing starts at zero, not one, which means the last index is always one less than the length of the item. If you try to access an index equal to the length, the program may throw an "index out of range" reference error or print `undefined`. 要小心:在一个循环内部重置一个全局变量 无限循环:1. 错误地增加/减小记数变量;2. 错误地重置计数器值/索引值,而不是加减它们 ```


No notes link to this note