Maths Flashcards
1
Q
Convert string to integer
A
parseInt(‘123’)
2
Q
Convert number to string
A
num.toString()
3
Q
Convert string to floating point
A
parseFloat(‘123.45’)
4
Q
Round number
A
Math.round()
5
Q
Round number down
A
Math.floor(number)
6
Q
Round up number
A
Math.ceil(number)
7
Q
Generate random number
A
Math.random()
8
Q
Find min number in list
A
let min = Math.min(…arr)
9
Q
Find max number in list
A
let max = Math.max(…arr)