You-Dont-Know-JS
You-Dont-Know-JS copied to clipboard
A book series on JavaScript. @YDKJS on twitter.
At line 97, this : **and it's not marked as read-only (`writable:false`)** should actually be this : **and it's not marked as read-only (`writable:true`)**
Lines 199 and 203 both describe `setup` and `teardown` code for jsperf tests. This is duplicate information, and one should be removed. In my opinion, it makes more sense to...
Fixed bug in function 'onlyOne', where onlyOne(2,0,0) would return false because it was adding the (non coerced) value of the argument to the sum. Also onlyOne(2,0,-1) would return true
ES6 now allows: ``` js var Foo = { .. }; var Bar = { __proto__: Foo, .. }; ``` This is obviously now much preferable in OLOO style, though...
In the end of the chapter there's an example and statement: ```js var myObject = { a: 2, b: 3 }; Object.defineProperty( myObject, Symbol.iterator, { enumerable: false, writable: false, configurable:...
Update various parts of the text. There's no such thing as "early ReferenceError" anymore (for things like `0++`); they're all just "early SyntaxError" now. https://github.com/tc39/ecma262/issues/691
Hi! In the [Early Completion](https://github.com/getify/You-Dont-Know-JS/blob/master/es6%20%26%20beyond/ch3.md#early-completion) section there is a sentence: `In addition to return(..) being callable manually, it's also called automatically at the end of iteration by any of the...
I've been trying to wrap my brain around the recursive `yield`-delegation example in [ch4](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch4.md#delegating-recursion), but I can't quite seem to fully grok it, so I'm hoping you could clearify a...
https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch6.md#benchmarking You could use the built-in `console.time()` and `console.timeEnd()` in this benchmarking example, as the `console` offers many more options than just `log()`. https://developer.mozilla.org/en-US/docs/Web/API/Console/time ``` console.time() // do some operation...
Link: https://github.com/getify/You-Dont-Know-JS/blob/master/types%20%26%20grammar/ch3.md#native-prototypes The code example is as follows: ``` function isThisCool(vals, fn, rx) { vals = vals || Array.prototype; fn = fn || Function.prototype; rx = rx || RegExp.prototype; return...