Answered by : code-grepper
var myNumber=120;
var myString = myNumber.toString(); //converts number to string "120"
Source : | Last Update : Fri, 09 Aug 19
Answered by : e
var myNumber=120;
var myString = myNumber.toString(); //converts number to string "120"
Source : | Last Update : Sat, 28 Mar 20
Answered by : redeluni
const num = 123; //> type number 123
const str = num.toString(); //> type string "123"
Source : | Last Update : Mon, 06 Apr 20
Answered by : tiago-frana
//Way #1
n = 334
n.toString()
//Way #2
(334).toString()
Source : | Last Update : Sat, 01 Jan 22
Answered by : anxious-ant-coyijuty29ih
var number = 1212
var numberString = number.toString();//converts my number that is '1212' to a string
Source : | Last Update : Fri, 02 Oct 20
Answered by : enchanting-eland-gyz95w6e0c4z
const num = 2
const a = num.toString() // This throws an Error if num is null or undifined
const b = String(num) // In a case above, puts "null" or "undifined"
Source : | Last Update : Fri, 01 Oct 21
Answered by : curious-chamois-u1343qzuywec
const number = 42;
console.log(number.toString());
// => "42"
Source : https://kitt.lewagon.com/camps/669/played_cards/deck?path=04-Front-End%2F04-JavaScript-basics | Last Update : Wed, 22 Sep 21
Answered by : grieving-gharial-54afdxs4rdwl
let a = '' + 50 // '50';
Source : https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiXj-2-wo7vAhWOMBQKHS3gA14QFjABegQIARAD&url=https%3A%2F%2Fstackabuse.com%2Fjavascript-convert-number-to-string%2F&usg=AOvVaw0AUgKd88KZKmLUGDUChHas | Last Update : Mon, 08 Mar 21
Answered by : vikas
const toNumber = str => +str;
// Example
toNumber('42'); // 42
Source : | Last Update : Fri, 10 Jul 20