Answers for "constant arrays in javascript"

0

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
Posted by: Guest on January-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language