JavaScript Cheat Sheet
JavaScript Arrays
concat() Join several arrays into one
copyWithin() Copy array elements within the array,
to and from specified positions
indexOf() Return the primitive value of the
specified object
includes() Check if an array contains the
specified element
join() Combine elements of an array into a
single string and return the string
entri
...[Show More]
JavaScript Cheat Sheet
JavaScript Arrays
concat() Join several arrays into one
copyWithin() Copy array elements within the array,
to and from specified positions
indexOf() Return the primitive value of the
specified object
includes() Check if an array contains the
specified element
join() Combine elements of an array into a
single string and return the string
entries() Return a key/value pair Array Iteration
Object
every() Check if every element in an array
passes a test
fill() Fill the elements in an array with a
static value
filter() Create a new array with every
element in an array that pass a test
find() Return the value of the first element
in an array that pass a test
forEach() Call a function for each array element
from() Create an array from an object
lastIndexOf() Give the last position at which a given
element appears in an array
pop() Remove the last element of an array
push() Add a new element at the end
reverse() Sort elements in descending order
reduce() Reduce the values of an array to a
single value (going left-to-right)
reduceRight() Reduce the values of an array to a
single value (going right-to-left)
shift() Remove the first element of an array
slice() Pull a copy of a portion of an array into
a new array object
sort() Sort elements alphabetically
splice() Add elements in a specified way and
position
unshift() Add a new element to the beginning
JavaScript Boolean Methods
toString() Convert a Boolean value to a string,
and return the result
valueOf() Return the first position at which a
given element appears in an array
toSource() Return a string representing the
source code of the object
JavaScript Arithmetic Operators
+ Addition
- Subtraction
* Multiplication
/ Division
(...)
Grouping operator (operations within
brackets are executed earlier than
those outside)
% Modulus (remainder)
++ Increment numbers
-- Decrement numbers
== Equal to
=== Equal value and equal type
!= Not equal
!== Not equal value or not equal type
> Greater than
< Lesser than
>= Greater than or equal to
<= Lesser than or equal to
? Ternary operator
Logical Operators
&& Logical AND
|| Logical OR
! Logical NOT
Bitwise Operators
& AND statement
| OR statement
~ NOT
^ XOR
<< Left shift
>> Right shift
>>> Zero fill right shift
[Show Less]