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

We want to declare a distance constant and initialize it with the value 120. What should such a declaration look like?

  • const distance = 120;
  • const distance; distance = 120;
  • let distance; const distance = 120;
  • let constant distance = 120;
Answers Explanation & Hints:

In JavaScript, when declaring a constant using the const keyword, you need to provide both the constant name and its initial value in a single statement. Therefore, the correct way to declare and initialize the constant distance with the value of 120 is by using the code snippet above.

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