1/5
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What keyword is used to create a read-only, named constant in JavaScript?
const
Can a constant be reassigned or redeclared?
No, constants cannot be reassigned or redeclared.
What is the scope rule for constants declared with const?
They follow the same block-scope rules as let.
Can a constant have the same name as a function in the same scope?
No, it will cause an error.
Does const prevent mutations to the properties of an object?
No, it only prevents reassignment, not mutations.
What happens if you try to push a new element to a constant array?
It executes without problems, as the array itself is not protected from mutations.