Constants

0.0(0)
studied byStudied by 0 people
0.0(0)
linked notesView linked note
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

6 Terms

1
New cards

What keyword is used to create a read-only, named constant in JavaScript?

const

2
New cards

Can a constant be reassigned or redeclared?

No, constants cannot be reassigned or redeclared.

3
New cards

What is the scope rule for constants declared with const?

They follow the same block-scope rules as let.

4
New cards

Can a constant have the same name as a function in the same scope?

No, it will cause an error.

5
New cards

Does const prevent mutations to the properties of an object?

No, it only prevents reassignment, not mutations.

6
New cards

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.