Created
March 21, 2022 02:17
-
-
Save nnhjs/b6f66155744b9d3dca3f7f724ec31508 to your computer and use it in GitHub Desktop.
Just Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code: Intrucstion | |
Expressions are questions that Javascript can answer. Javascript answers expressions in the only way it knows how - with values. | |
Variables are Wires, Varaibles are not Values | |
Values: | |
Types of Values: | |
Primitive Values: Immutable values | |
1. Undefined | |
One value is undefined | |
2. Null | |
One value is null | |
3. Boolean | |
Two value is true and false | |
4. Number | |
-2^64 --> 2^64 values | |
5. BigInt | |
Infinity values | |
6. String | |
Infinity values | |
7. Symbol | |
Learn more | |
Object | |
{} | |
Function | |
() | |
Checking a type: typeof | |
Equality of Values | |
Same is equal: Object.is() | |
Strict equal === | |
NaN === NaN : false | |
0 === -0: true | |
Lose equal == | |
Properties | |
Similar variables but variables start from my code, properties start from object. | |
obj.property is calculated in three step: | |
1. figure out which value in on the left | |
2. If it's null or undefined, throw an error | |
3. If that property exists, the result in the value it points to. If that property doesn't exist, the result is undefined. | |
Mutation | |
Objects are never "nested" in our universe - pay close attention to the wires | |
Carefully | |
Prototype | |
Link object to object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment