Skip to content

Commit 2693912

Browse files
committed
Update prototype question
1 parent 1d9cd77 commit 2693912

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@
12961296

12971297
This behavior is part of **JavaScript's ES6 (ECMAScript 2015)** specification and applies **only to variables declared with `let` and `const`**, not `var`. Variables declared with `var` are **hoisted** and initialized with `undefined`, so accessing them before the declaration does not throw an error, though it can lead to unexpected results.
12981298

1299-
23. ### Example
1299+
#### Example
13001300

13011301
```javascript
13021302
function someMethod() {
@@ -2026,6 +2026,8 @@
20262026
20272027
68. ### What is a strict mode in javascript
20282028
2029+
JavaScript’s "use strict" directive is used to opt into a stricter parsing and error-handling mode for your scripts or functions. It helps catch common bugs, makes your code more secure, and prepares it for future versions of JavaScript.
2030+
20292031
Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a “strict” operating context. This way it prevents certain actions from being taken and throws more exceptions. The literal expression `"use strict";` instructs the browser to use the javascript code in the Strict mode. This also enables block-scoped variables.
20302032
20312033
**[⬆ Back to Top](#table-of-contents)**
@@ -6551,7 +6553,11 @@
65516553
65526554
343. ### Do all objects have prototypes
65536555
6554-
No. All objects have prototypes except the base object or an object created with Object.create(null) method. The base object is Object.prototype, and its prototype is null.
6556+
No. All objects have prototypes except two exceptions:
6557+
* **Object.prototype** itself — This is the base object in the prototype chain, and **its prototype is** `null`.
6558+
* **Objects created with** `**Object.create(null)**` — These are deliberately created with **no prototype**, so they don’t inherit from `Object.prototype`.
6559+
6560+
All other standard objects do have a prototype.
65556561
65566562
**[⬆ Back to Top](#table-of-contents)**
65576563

0 commit comments

Comments
 (0)