Show Menu
Cheatography

js Cheat Sheet (DRAFT) by [deleted]

JavaScript CheatSheet

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Variables

var myInteger = 4;
declare & init an integer variable
var myResult = a + b;
addition operation
 

Arrays

var myArray = ["st­rin­g", 124, "­antoher string­", 23.4, ["do­ubl­e", 'singl­e']];
create array
var myVari­able= myArra­y[i];
access array with index
myArra­y.p­ush­(32);
push 32 to end
myArra­y.u­nsh­ift­(32);
push 32 to start
var myVar = myArra­y.p­op();
pop from end
var myvar = myArra­y.s­hift();
pop from start