wtfjs
Зеркало из https://github.com/denysdovhan/wtfjs
ФоркИзбранное
0
0
9 лет назад
9 лет назад
9 лет назад
8 лет назад
8 лет назад
8 лет назад
8 лет назад
8 лет назад
What the f\ck JavaScript?
Node Packaged Manuscript
Translations
Table of Contents
💪🏻 Motivation
✍🏻 Notation
👀 Examples
`[]` is equal `![]`
`true` is not equal `![]`, but not equal `[]` too
true is false
baNaNa
`NaN` is not a `NaN`
It's a fail
`[]` is truthy, but not `true`
`null` is falsy, but not `false`
`document.all` is an object, but it is undefined
Minimal value is greater than zero
function is not a function
Adding arrays
Trailing commas in array
Array equality is a monster
`undefined` and `Number`
`parseInt` is a bad guy
Math with `true` and `false`
HTML comments are valid in JavaScript
`NaN` is not a number
`[]` and `null` are objects
Magically increasing numbers
Precision of `0.1 + 0.2`
Patching numbers
Comparison of three numbers
Funny math
Addition of RegExps
Strings aren't instances of `String`
Calling functions with backticks
Call call call
A `constructor` property
Object as a key of object's property
Accessing prototypes with `proto`
`${{Object}}`
Destructuring with default values
Dots and spreading
Labels
Nested labels
Insidious `try..catch`
Is this multiple inheritance?
A generator which yields itself
A class of class
Non-coercible objects
Tricky arrow functions
Arrow functions can not be a constructor
`arguments` and arrow functions
Tricky return
Accessing object properties with arrays
Null and Relational Operators
`Number.toFixed()` display different numbers
`Math.max()` less than `Math.min()`
Comparing `null` to `0`
Same variable redeclaration
📚 Other resources
🎓 License
README.md