diff --git a/files/en-us/web/javascript/guide/grammar_and_types/index.md b/files/en-us/web/javascript/guide/grammar_and_types/index.md index 71a7e3581c247da..b1d332cfe67b576 100644 --- a/files/en-us/web/javascript/guide/grammar_and_types/index.md +++ b/files/en-us/web/javascript/guide/grammar_and_types/index.md @@ -517,6 +517,16 @@ Object literals support a range of shorthand syntaxes that include setting the p Together, these also bring object literals and class declarations closer together, and allow object-based design to benefit from some of the same conveniences. ```js +// If `theProtoObj` and `handler` are not declared, +// the code will throw a ReferenceError: +// "theProtoObj is not defined" or "handler is not defined" + +const theProtoObj = { + /*The proto Object*/ +}; +const handler = { + /*Handler*/ +} const obj = { // __proto__ __proto__: theProtoObj,