Quote:
Originally Posted by felgall
but parseInt() in JavaScript doesn't convert the values to integers, it converts between number bases eg base 16 to base 10
Math.floor() is the JavaScript function to convert from a float to an integer.
|
We are like "Rock'em-Sock'em Robots"... trying to knock off each other's block.
parseInt defaults to base 10 so it does the same thing as Math.floor.
As to which one is "better"... does it matter? Do you eat the cake first, or the frosting first? And does it matter either way?