Concatenate Two Numbers Using JavaScript

 

To concatenate two numbers in JavaScript using toString() method. toString() converts an number into string
 

const number = 1;
const number2 = 2;
const concatString = number1.toString() + number2.toString();

console.log(concatString); //12
console.log(typeof concatString); //String

Tags:

Share:

Related posts