Symbol
摘要:【Symbol】 The Symbol() function returns a value of type symbol. it does not support the syntax "new Symbol()". Every symbol value returned from Symbol(
阅读全文
Object.defineProperty
摘要:【Object.defineProperty】 1、The Object.defineProperty() method defines a new property directly on an object, or modifies an existing property on an obje
阅读全文
动态作用域
摘要:【动态作用域】 作用域有两种: 1、动态作用域 2、词法作用域 JavaScript 中的作用域就是词法 作用域(事实上大部分语言都是基于词法作用域的)。但实际上动态作用域是 JavaScript 另一个重要机制 this 的表亲 词法作用域让 foo() 中的 a 通过 RHS 引用到了全局作用域
阅读全文
eval()
摘要:【eval】 1、只处理字符串 If the argument of eval() is not a string, eval() returns the argument unchanged. In the following example, the String constructor is
阅读全文
common mistake of closure in loops
摘要:【common mistake of closure in loops】 下例中item引用的始终是最后一个值。 function showHelp(help) { document.getElementById('help').innerHTML = help; } function setupH
阅读全文
Emulating private methods with closures
摘要:【Emulating private methods with closures】 JavaScript does not provide a native way of doing this, but it is possible to emulate private methods using
阅读全文
Computed property names
摘要:【Computed property names】 That allows you to put an expression in brackets [], that will be computed as the property name. 参考:https://developer.mozill
阅读全文
Spread Syntax
摘要:【Spread Syntax】 The spread syntax allows an expression to be expanded in places where multiple arguments are expected. 1、为了将[]传递给一个函数,过去使用apply方法 ES20
阅读全文
Template literals
摘要:【Template literals】 Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation featu
阅读全文
Javascript Iterator
摘要:【Javascript Iterator】 1、@@iterator Whenever an object needs to be iterated (such as at the beginning of a for..of loop), its @@iteratormethod is calle
阅读全文
Arrow Function
摘要:【Arrow Function】 1、Basic Syntax 2、Advanced Syntax 3、No binding of this An arrow function does not create its own this context, so this has its origina
阅读全文
destructuring assignment
摘要:【destructuring assignment】 The destructuring assignment syntax is a JavaScript expression that makes it possible to extract data from arrays or object
阅读全文
new.target
摘要:【new.target】 The new.target property lets you detect whether a function or constructor was called using the newoperator. In constructors and functions
阅读全文
Javascript Hoisting
摘要:【Javascript Hoisting】 hoisting teaches that variable and function declarations are physically moved to the top your coding, but this is not what happe
阅读全文
Javascript Bind
摘要:【Javascript Bind】 The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of
阅读全文
Javascript Property Names
摘要:【Javascript Property Names】 Property names must be strings. This means that non-string objects cannot be used as keys in the object. Any non-string ob
阅读全文
==与===
摘要:【==与 】 ==, 两边值类型不同的时候,要先进行类型转换,再比较。 ,不做类型转换,类型不同的一定不等。 参考:http://relucent.iteye.com/blog/835521
阅读全文
javascript中所有函数的参数都是按值传递的
摘要:【javascript中所有函数的参数都是按值传递的】 参考:http://www.jb51.net/article/89297.htm
阅读全文
Promise.race
摘要:【Promise.race】 返回最先完成的promise https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race
阅读全文
javascript 伪协议
摘要:【javascript 伪协议】 将javascript代码添加到客户端的方法是把它放置在伪协议说明符javascript:后的URL中。这个特殊的协议类型声明了URL的主体是任意的javascript代码,它由javascript的解释器运行。如果javascript:URL中的javascrip
阅读全文