Skip to content

Commit 1ed4fef

Browse files
authored
Remove accidental text on supply chain page (#41462)
1 parent 70285e3 commit 1ed4fef

File tree

1 file changed

+0
-34
lines changed
  • files/en-us/web/security/attacks/supply_chain_attacks

1 file changed

+0
-34
lines changed

files/en-us/web/security/attacks/supply_chain_attacks/index.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -209,37 +209,3 @@ See [Subresource Integrity](/en-US/docs/Web/Security/Subresource_Integrity) for
209209
## See also
210210

211211
- [Software Supply Chain Security](https://cheatsheetseries.owasp.org/cheatsheets/Software_Supply_Chain_Security_Cheat_Sheet.html) at [owasp.org](https://owasp.org/)
212-
213-
JavaScript implements {{glossary("inheritance")}} using _prototypes_. Each object has a prototype, which it itself an object, and which itself has a prototype, and so on, until we get to the fundamental prototype, which is called `Object.prototype`, whose own prototype is `null`.
214-
215-
If you try to access a property or call a method on an object, and that property or method isn't defined on the object, then the JavaScript runtime looks in the object's prototype for the property or method, and then in the object's prototype's prototype, and so on, until it finds the method of property or reaches an object whose prototype is `null`.
216-
217-
That's why you can do this:
218-
219-
```js
220-
const myArray = new Array(1, 2, 3);
221-
// prototype chain:
222-
// myArray -> Array -> Object -> null
223-
224-
myArray.length;
225-
// 3
226-
// length is defined on the prototype of `myArray`, which is `Array.prototype`
227-
228-
myArray.toString();
229-
// "1,2,3"
230-
// toString() is defined on the prototype of `Array.prototype`, which is `Object`
231-
```
232-
233-
Unlike many other languages, JavaScript allows you to add inherited properties and methods at runtime by modifying an object's prototypes:
234-
235-
```js
236-
const myArray = new Array(1, 2, 3);
237-
238-
// modify the Object prototype at runtime
239-
Object.prototype.extra = "new property!";
240-
241-
myArray.extra;
242-
// "new property!"
243-
```
244-
245-
In a prototype pollution attack, the attacker is able to change the object's prototype to make the object behave in unexpected or dangerous ways.

0 commit comments

Comments
 (0)