Js Cheatsheet 1
Js Cheatsheet 1
Js Cheatsheet 1
scoped.
properties.
Variables
access members
+ Addition
- Subtraction
* Multiplication
/ Division
() Grouping operator
% Modulus (remainder)
++ Increment numbers
-- Decrement numbers
Operators
Comparison Operators
== Equal to
!= Not equal
|| Logical or
! Logical not
Bitwise Operators
Bitwise operators in Javascript are mostly used for
numerical conversions/computations, because
sometimes they're much faster than their Math or
parseInt equivalents
Operators
Bitwise Operators
| OR statement
~ NOT
^ XOR
// statements
// statements
Arrow Function
// statements
}
Conditional Statements
Use if to specify a block of code to be executed, if
a specified condition is true
If - Else Statements
if (condition) {
condition is true
} else {
condition is false
}
Conditional Statements
If - Else If - Else Statements
if (condition1) {
condition is true
} else if (condition2) {
condition2 is true
} else {
// code to be executed if
condition2 is false
}
Conditional Statements
Switch Statement
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
The switch expression is evaluated once.
The value of the expression is compared with the
values of each case.
If there is a match, the associated block of code is
executed.
If there is no match, the default code block is
executed.
Conditional Statements
Ternary Operator
condition
An expression whose value is used as a condition.
exprIfTrue
An expression which is executed if the condition is
truthy.
exprIfFalse
An expression which is executed if the condition is
falsy.
Truthy / Falsy Values
FALSY Values
false
0 (zero)
null
undefined
TRUTHY Values
Escape Characters
\\ Backslash
\b Backspace
\f Form feed
\n New line
\r Carriage return
\t Horizontal tabulator
\v Vertical Tabulator
Want to Become a
JavaScript Master ?
If you’re serious about learning JavaScript and
• 10 hours of HD video
• Unlimited access
• Certificate of completion
CHEATSHEET
https://www.completepathtojavascriptmastery.com
- JavaScript Mastery
jsmasterypro javascriptmastery