Home »
MCQs »
JavaScript MCQs
Which is the correct syntax to declare a constant in JavaScript?
23. Which is the correct syntax to declare a constant in JavaScript?
- const constant_name;
- constant_name const;
- constant_name const = value;
- const constant_name = value;
Answer: D) const constant_name = value;
Explanation:
The correct syntax to declare a constant is:
const constant_name = value;
Example:
const PI = 3.14;