constant arrays in javascript
const check = ['orange', 'banana', 'apple']
// we can perform all the array operations on the constant array so almost no difference
check.push("pineappled") // pushes "pineappled" into the check
check[3] = "pineapple" // modification is also possible
check.pop() //returns "pineapple"
// but it cant be reassigned
// check = ["newone"] this raises an TYPE ERROR
Are there any code examples left?
New code examples in category Javascript