< > iLoveCoding
JavaScript Cheatsheet
Page 1
Learn JavaScript Correctly (Video course) https://ilovecoding.org/courses/js2
1 Seven (7) Types 2 Basic Vocabulary
{
Variable Operator
1. String "Any text" A named reference to Operators are reserved-words that
Six Primitive Types
a value is a variable. perform action on values and variables.
2. Number 123.45
Examples: + - = * in === typeof != ...
3. Boolean true or false
4. Null null { Statement
5. Undefined undefined var a = 7 + "2"; A group of words, numbers
and operators that do a
{
6. Symbol Symbol('something') task is a statement.
Note: var, let &
7. Object { key: 'value'} const are all Keyword / reserved word
- Array [1, "text", false] valid keywords to Any word that is part of Expression
declare variables. the vocabulary of the
- Function function name() { } The difference A reference, value or a
between them is
programming language is group of reference(s)
covered on page 7 called a keyword and value(s) combined
of this cheatsheet. (a.k.a reserved word). with operator(s), which
3 Object Examples: var = + if for... result in a single value.
An object is a data type in var user = {
JavaScript that is used to store
a combination of data in a
simple key-value pair. Thats it.
name: "Aziz Ali",
yearOfBirth: 1988,
calculateAge: function(){
{ Value
These are the
values of the
respective keys
Method
If a key has a
function as a
value, its called
Key // some code to calculate age in user object. a method.
These are the }
keys in user object.
}
iLoveCoding
"Don't just learn JavaScript - Become a Full-Stack JavaScript Developer" https://iLoveCoding.org