We want to convert the string “1024” to type Number and store the result in variable n. Point out the correct statement

  • Post author:
  • Post category:Q&A
  • Reading time:1 min read
  • Post last modified:March 15, 2025

We want to convert the string "1024" to type Number and store the result in variable n. Point out the correct statement

  • let n = Number("1024");
  • let n = String("1024");
  • let n = StringToNumber("1024");
  • let n = "1024" + 0;
Answers Explanation & Hints:

The correct answer is:

let n = Number("1024");

This code converts the string “1024” to a number using the Number() function and stores the result in the variable n.

For more Questions and Answers:

JavaScipt Essentials 1 (JSE) | JSE1 – Module 2 Test Exam Answers Full 100%