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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Math.round()

A

method rounds a number to the nearest integer

let a = 2.4
console.log(Math.round(a)//2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Math.sqrt()

A

returns the square root of a number

let a = Math.sqrt(25)//5
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Math.floor()

A

this method rounds a number DOWN to the nearest integer

let a = Math.floor(25.90)//25

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

join()

A

array.join(separator)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly