摘要:
最近在刷 freeCodeCamp 上面的题目,遂想着把一些 js 的题目记录下来。 原题: JavaScript Algorithms and Data Structures Projects: Palindrome Checker Return true if the given string 阅读全文
摘要:
this 的值取决于代码的执行环境(execution context),this 存在于函数中,在声明时不会被绑定,只在调用时被绑定。只要记住,谁调用,绑定谁,就不会糊涂。 1.默认绑定 函数直接在全局环境下执行,严格模式下 this 为 undefined,非严格模式下 this 为 windo 阅读全文