showing results for - "constant arrays in javascript"
Matteo
07 Nov 2019
1const check = ['orange', 'banana', 'apple']
2// we can perform all the array operations on the constant array so almost no difference 
3check.push("pineappled") // pushes "pineappled" into the check
4check[3] = "pineapple" // modification is also possible
5check.pop() //returns "pineapple"
6// but it cant be reassigned
7// check = ["newone"] this raises an TYPE ERROR
8
similar questions
queries leading to this page
constant arrays in javascript