Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Defining Variables with let and const!
You have completed Defining Variables with let and const!
Preview
Using constants prevents values from being reassigned but how do they work with arrays and objects?
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
The same goes for
any value of a constant variable.
0:00
You cannot reassign strings, numbers,
booleans, objects, and arrays.
0:00
Unlike strings, numbers, and booleans,
objects in arrays have methods and
0:05
properties that modify the objects or
array.
0:09
Do they still work with const?
0:13
First we'll declare a variable,
which is a constant called days.
0:15
This will contain an array
with a single string "Monday".
0:24
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up