Does JavaScript Support automatic type conversion, If yes give example.

  • : 405
  • : 14
    Previous Next

    Yes! Javascript support automatic type conversion. You should take advantage of it, It is most common way of type conversion used by Javascript developers.

    var s = '5';
    var a = s*1;
    var b = +s;
    typeof(s); //"string"
    typeof(a); //"number"
    typeof(b); //"number"

    you can suggest other answer in comment box

  • Exam: Java Script Interview QUESTIONS

    Recommended Learning for you

    Subscribe here for free mock test on IAS PCS SSC and other competitive exam. Signup here to get SSC CGL Solution and main exam study material