+ 1

What does parseInt() doing here?

Image.style.left = parseInt(Image.style.left) + 10 + 'px';

2nd Jun 2020, 3:38 AM
Keshav Bhattarai
Keshav Bhattarai - avatar
2 Answers
+ 1
The parseInt() function parses a string and returns an integer. The radix parameter is used to specify which numeral system to be used, for example, a radix of 16 (hexadecimal) indicates that the number in the string should be parsed from a hexadecimal number to a decimal number.
2nd Jun 2020, 5:26 AM
James Clark I. Vinarao
James Clark I. Vinarao - avatar