Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Automatic Conversion of Numeric Strings to Numbers</title> </head> <body> <script> // Creating variables var x = 10; var y = 20; var z = "30"; // Subtracting a number from a number document.write(y - x); // 10 document.write("<br>"); // Subtracting a number from a numeric string document.write(z - x); // 20 document.write("<br>"); // Multiplying a number with a numeric string document.write(x * z); // 300 document.write("<br>"); // Dividing a number with a numeric string document.write(z / x); // 3 </script> </body> </html>