js_flashcards_strict_mode

(5 cards)

1
Q

What is JavaScript Strict Mode, and how do you enable it?

A

Strict Mode restricts JavaScript to catch common mistakes and unsafe actions. Enable with ‘use strict’; at start of script or function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Three behaviors different in strict vs non-strict mode?

A
  1. Accidental globals throw errors.
  2. this is undefined in functions without context.
  3. Assigning to read-only properties throws errors.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why use meaningful naming conventions?

A

Improves readability, maintainability, and collaboration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why is consistent indentation important?

A

It structures code visually and improves readability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do ES Modules improve code?

A

Enable explicit import/export, enforce modularity, prevent naming collisions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly