Show Menu
Cheatography

Javascript By Meta Course (2023) Cheat Sheet (DRAFT) by

Basic Fundamental of Javascript

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

Methods of Objects

 
charAt()

concat()

indexOf()

lastIn­dexOf()

split()

toUppe­rCase()

toLowe­rCase()

Math Object

The PI number: Math.PI which is approx­imately 3.14159

The Euler's constant: Math.E which is approx­imately 2.718

The natural logarithm of 2: Math.LN2 which is approx­imately 0.693

______­___­___­___­___­___­___­___­___­___­___­___­___­___­___­_______

Math.c­eil() - rounds up to the closest integer

Math.f­loor() - rounds down to the closest integer

Math.r­ound() - rounds up to the closest integer if the decimal is .5 or above; otherwise, rounds down to the closest integer

Math.t­runc() - trims the decimal, leaving only the integer

______­___­___­___­___­___­___­___­___­___­___­___­___­___­___­_______

non-co­ncl­usive list of some common arithmetic and calculus methods that exist on the Math object:

Math.pow(2,3) - calculates the number 2 to the power of 3, the result is 8

Math.sqrt(16) - calculates the square root of 16, the result is 4

Math.cbrt(8) - finds the cube root of 8, the result is 2

Math.abs(-10) - returns the absolute value, the result is 10

Logari­thmic methods: Math.log(), Math.l­og2(), Math.l­og10()

Return the minimum and maximum values of all the inputs: Math.min(9,8,7) returns 7, Math.max(9,8,7) returns 9.

Trigon­ometric methods: Math.sin(), Math.cos(), Math.tan(), etc.