Constants (स्थिरहरू)
Constants were introduced in ES6(2015), and use a const keyword. Variables that are declared with const cannot be reassigned or redeclared.
स्थिरहरू ईएस ६ (2015) मा प्रस्तुत गरिएको थियो, र कन्स्ट कीवर्ड प्रयोग गर्दछ। कन्स्ट सँग घोषणा गरिएका भेरिएबलहरू पुन: असाइन गर्न वा पुन: परिभाषित गर्न सकिँदैन।
Example:
const VERSION = '1.2';
📝 Task:
[ ] Run the program mentioned below and fix the error that you see in the console. Make sure that the code result is
0.9when it is fixed in the console.[ ] तल उल्लिखित प्रोग्राम चलाउनुहोस् र तपाईँले कन्सोलमा देख्नुभएको त्रुटि ठीक पार्नुहोस् । निश्चित गर्नुहोस् कि कोड परिणाम
०.९हो जब यो कन्सोलमा फिक्स गरिएको छ।
const VERSION = '0.7';
VERSION = '0.9';
console.log(VERSION);