Methods Flashcards
1
Q
toFixed()
A
method rounds the string to a specified number of decimals (returns a string)
let numbr = 123.123456 console.log(numbr.toFixed(3)// 123.123
2
Q
Math.round()
A
method rounds a number to the nearest integer
let a = 2.4 console.log(Math.round(a)//2
3
Q
Math.sqrt()
A
returns the square root of a number
let a = Math.sqrt(25)//5
4
Q
Math.floor()
A
this method rounds a number DOWN to the nearest integer
let a = Math.floor(25.90)//25
5
Q
join()
A
array.join(separator)