faqts : Computers : Programming : Languages : JavaScript : Language Core : Numbers

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 21 people (62%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

how to convert a numeric-variable to a string-variable

Jun 5th, 2003 08:36
Gran Causa, carsten dfgb,


Via String contructor:
var my_number = 6;
var my_string = new String(my_number);
or automatic casting if you are joining strings:
var another_string = "I am " + my_number + " javascript years old!";