var myNumber=120;
var myString = myNumber.toString(); //converts number to string "120"
var myNumber=120;
var myString = myNumber.toString(); //converts number to string "120"
//Way #1
n = 334
n.toString()
//Way #2
(334).toString()
var number = 1212
var numberString = number.toString();//converts my number that is '1212' to a string
function numberToString(num) {
return num + '';
}
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"
(int).toString()
function numberToString(num) {
// Return a string of the number here!
return String(num);
}
let a = '' + 50 // '50';
const number = 42;
console.log(number.toString());
// => "42"
const toNumber = str => +str;
// Example
toNumber('42'); // 42
function numberToString(num) {
return ''+num;
}
const numberToString = num => `${num}`;