To concatenate two numbers as strings,

  1. Simply add an empty string to it.

    Example code:
    var num1 = 50;
    var num2 = 25;
    var concatenatedString = "" + num1 + num2;


    *Note: This example will fail JSLint.

  2. Use toString() on any one variable or both.

    Example code:
    var num1 = 50, num2 = 25, concatenatedString = num1.toString() + num2;
    var num1 = 50, num2 = 25, concatenatedString = num1.toString() + num2.toString();

    *Note: This code will pass JSLint.