Javascript Cheatsheet Page2 HD Codemio

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

javascript ■ teat page Js


Js Programming (Language of (P11
2 PROPERTIES

Q.E Euler's cons


Q.LN2 natural lo
IDIN10 natural l
Q.LOG2E base 2
b.hasOwnProperty(prop) check if exist PROPERTIES
CI.LOG10E base
b .isPrototypeOf(obj) test in another El.size return number of items CI.PI ratio circum
obj b .propertylsEnumerable(prop) METHODS Q.SQRT1_2 squa
.toString() return equivalent string
0.add(item) add item to set Q.SQRT2 ,.quarews
.toLocaleString() return locale
b .has(item) check if item exists ws
version 0 .valueOf() return primitive
b .delete(item) del item & return if del ws
value
.clear() remove all items from set
p Promise() I_____________________________.1.__•
METHODS
0.entrieso iterate items
El.values() iterate only value of items
_111
„M. .forEach(cb(e,i,a), arg) exec for each

PROPERTIES

M.size return number of elements


METHODS

al.set(key, value) add pair key=value wm


0 .get(key) return value of key wm
b .has(key) check if key exist wm
b .delete(key) del elem. & return if ok wm
Pri.clearo remove all elements from map

Menthes() iterate elements


.keys() aerate only keys
21.values() iterate only values

M.forEach(cb(e,i,a), arg) exec for each

Symbol()
PROPERTIES

METHODS

PROGRAMMING
Q.abs(x) absolu
Q.cbrt(x) cube r
Q.clz32(x) return
Q.exp(x) return
(D.expm1(x) retu
CI.hypot(x1, x2...
Q.imul(a, b) sign
Q.log( ) natural
C).log1p(x) natu
4D.log10(x) base
CI.log2( c) base
Q.max(xl, x2...)
e.min(x1, x2...) r
Q.pow(base, exp
Q.random() float
Q.sign(x) return
C).sqrt(x) square
Q.ceil(x)
superior
round
(smallest
)
Q.floor(x
) inferior
round
(largest)
Q.fround(
x)
nearest
single
precision
Q.round(
x) round
(nearest
integer)
Q.trunc(x
) remove
fractional
digits
,H
Q.acos(x) arcco
Q.acosh(x) hype
Q.asin(x) arcsin
Q.asinh(x) hyper
Cl.atan( c) arctan
Q.atan2(x, y) arc
Q.atanh(x) hype
CI.cos(v) cosine
Q.cosh(x) hyper
Q.sin( ) sine
CI.sinh( () hyper
Q.tan( ) tangen
Q.tanh(x) hyperb

J
S
O
N
M
E
T
H
O
C
I

I
I

Q.parse( r ,

tf(k,v)) parse
string to
object
Q.stringify(ob
j, repflwl, sp)
convert to str

E
r
r
o
r
(
)
P
R
O
P
E
R
T
I
E
S

'.name return
U .message retu
o Object()
PROPERTIES

o .constructor re
METHODS
(:).assign(d
st, src1,
src2...) copy
values
e.create(pro
to, prop)
create obj
w/prop
C).definePr
operties(ob
j, prop)
Q.definePro
perty(obj,
prop, desc)
eireeze(obj
) avoid
properties
changes
o.getOwnP
ropertyDesc
riptor(obj,
prop)
C).getOwnP
ropertyNam
es(obj)
C)
.getOwnPro
pertySymbo
ls(obj)
e.getPrototy
peOf(obj)
return
prototype
v
al2) check
if are same
value ()

.isExtensible(o
bj ) check if
can add
prop
O.isFrozen(
obj) check
if obj is
frozen
Q.isSealed(
obj) check
if obj is
sealed
0.keys(obj)
return only
keys of
object
e.preventEx
tensions(ob
j) avoid
extend
Q.seal(obj)
prop are
non-
configurabl
e
CI.setProtot
ypeOf(obj,
prot)
change prot
.all(obj) retur
.catch(onReje
.then(onFulfil
o.race(obj) retur
0.resolve(obj) r
^.reject(reason)

p Proxy()
METHODS

.apply(obj, arg, ar
.construct(obj, ar
.defineProperty(
.deleteProperty(o
delete .enumerat
.get(obj, pry - , re
.getOwnProperty
.getPrototypeOf(
) .-i
.ownKeys(011
.preventExtensio
.set(o , va

globals
METHODS

eval( tr)
evaluate
javascrip
t code
isFinite(o
bj) check
if is a
finite
number
isNaN(obj
) check if
is not a
number
C
parselnt(
, radix)
string to
integer
parseFloa
t( ,
radix)
string to
float
encodeUR
lCompone
nt(URI) =
to %3D
decodeUR
ICompon
ent(,""!)
%3D to =
o Aerator
specifies
default
iterator
0.match
specifies
match of
regexp
0.species
specifies
constructor
function
METHODS

.for( )
search
existing
symbols
.keyFor(
return
key from
global
reg

g Generator()
METHODS

0
.next(valu
e) return
obj
w/{value,
done} 0
.return(val
ue) return
value &
true done
.throw(exc
ept) throw
an error
O
t
h
e
r
s

FAST TIPS

var declare variable


let declare block scope local variable
const declare constant (read-only)
func(a=1) default parameter value
func(...a) est argument (spread operator)
(a) => { } function equivalent (fat arrow)
string ${a}' template with variables
Obn binary (2) number n to decimal
Oon octal (8) number n to decimal
Oxn hexadecimal (16) number n to decimal
for (i in array) { } terate array, i = index
for (e of array) { } iterate array, e = value
class B extends () } -lass sugar syntax

You might also like