• Post author:
  • Post category:Blog
  • Reading time:2 mins read
  • Post last modified:June 12, 2024

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%

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments