javascript toString Function

toString function converts a number to the specified string format, such as 2 based.

var nm=2;
nm.toString(2); //10
nm.toString(); //2
nm.toString(10); //2
nm.toString(8); //2

var nm = 24;
nm.toString(2); //11000
nm.toString(); //24
nm.toString(10); //24
nm.toString(8); //30
nm.toString(16); //18
endmemo.com © 2017  Terms of Use | Home