JavaScript Array Const
ECMAScript 2015 (ES6)
in 2015, JavaScript introduced an important new keyword: const.
It has become a common practice to declare arrays using const:
Cannot be Reassigned
An array declared with const cannot be reassigned:
Example
const cars = ["Saab", "Volvo", "BMW"];
cars = ["Toyota", "Volvo", "Audi"]; // ERROR
Try it Yourself »