0% found this document useful (0 votes)
18 views7 pages

JS Cheat Sheet

This document is a JavaScript cheat sheet that outlines various data types, control flow statements, and methods for strings, arrays, objects, math, dates, promises, events, and error handling. It also includes function types and miscellaneous functions. The author encourages readers to comment for a PDF version and join a Telegram group for additional resources.

Uploaded by

Vpn Account
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views7 pages

JS Cheat Sheet

This document is a JavaScript cheat sheet that outlines various data types, control flow statements, and methods for strings, arrays, objects, math, dates, promises, events, and error handling. It also includes function types and miscellaneous functions. The author encourages readers to comment for a PDF version and join a Telegram group for additional resources.

Uploaded by

Vpn Account
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

JavaScript

Cheat Sheet

Nikhil | FullStack Dev


@codewithnikhill
Data Types Loops
String for
Number while
Boolean do...while
Array for...of
Object for...in
Null
Undefined String Methods
Symbol
BigInt .charAt()
.concat()
Control Flow .includes()
.indexOf()
if .lastIndexOf()
else .slice()
else if .split()
switch .substring()
break .toLowerCase()
continue .toUpperCase()
.trim()
.replace()
.startsWith()
.endsWith()
@codewithnikhill 01
Array Methods

.push() .indexOf() .reduce()


.pop() .lastIndexOf() .forEach()
.shift() .includes() .some()
.unshift() .find() .every()
.concat() .findIndex() .sort()
.slice() .filter() .reverse()
.splice() .map() .join()

Object Methods

Object.keys() Object.seal()
Object.values() Object.create()
Object.entries() Object.hasOwnProperty()
Object.assign() Object.getPrototypeOf()
Object.freeze()

Comment “PDF” to get this PDF

@codewithnikhill 02
Math Methods

Math.abs() Math.min()
Math.ceil() Math.random()
Math.floor() Math.pow()
Math.round() Math.sqrt()
Math.max() Math.trunc()

Date Methods

.getDate() .setDate()
.getDay() .setFullYear()
.getFullYear() .setHours()
.getHours() .setMinutes()
.getMinutes() .setSeconds()
.getSeconds() .setMilliseconds()
.getMilliseconds() .setMonth()
.getMonth() .setTime()
.getTime()

@codewithnikhill 03
Number Methods Promise Methods
.toFixed() Promise.all()
.toPrecision() Promise.race()
.toString() Promise.resolve()
Number.isInteger() Promise.reject()
Number.isNaN() .then()
.catch()
.finally()

Event Methods Error Handling


.addEventListener() try
.removeEventListener() catch
.stopPropagation() finally
.preventDefault() throw

@codewithnikhill 04
Miscellaneous Function Types
setTimeout() Regular Functions
setInterval() Arrow Functions
clearTimeout() Anonymous Functions
clearInterval() Immediately Invoked
parseInt() Function Expressions (IIFE)
parseFloat() Callback Functions
JSON.stringify() Higher-Order Functions
JSON.parse()
typeof
instanceof

Comment “PDF” to get this PDF

@codewithnikhill 05
Was It Helpful ?

Join Telegram for Free Coding


Resources and Notes

Link in bio !

Follow For More

You might also like