From 6d4fbc7c53ce9835fa944ed9ddc8866efe51997a Mon Sep 17 00:00:00 2001 From: Himanshu <74658643+digi-booster@users.noreply.github.com> Date: Tue, 28 Sep 2021 02:31:28 +0530 Subject: [PATCH] Add space before assignment operator in Working with objects js guide (#9299) fix - #9290 --- .../web/javascript/guide/working_with_objects/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/en-us/web/javascript/guide/working_with_objects/index.md b/files/en-us/web/javascript/guide/working_with_objects/index.md index cf5bc2043f50eff..2c1ca4fb4c2eae8 100644 --- a/files/en-us/web/javascript/guide/working_with_objects/index.md +++ b/files/en-us/web/javascript/guide/working_with_objects/index.md @@ -164,7 +164,7 @@ var obj = { property_1: value_1, // property_# may be an identifier... 'property n': value_n }; // or a string ``` -where `obj` is the name of the new object, each `property_i` is an identifier (either a name, a number, or a string literal), and each `value_i` is an expression whose value is assigned to the `property_i`. The `obj` and assignment is optional; if you do not need to refer to this object elsewhere, you do not need to assign it to a variable. (Note that you may need to wrap the object literal in parentheses if the object appears where a statement is expected, so as not to have the literal be confused with a block statement.) +where `obj` is the name of the new object, each `property_i` is an identifier (either a name, a number, or a string literal), and each `value_i` is an expression whose value is assigned to the `property_i`. The `obj` and assignment are optional; if you do not need to refer to this object elsewhere, you do not need to assign it to a variable. (Note that you may need to wrap the object literal in parentheses if the object appears where a statement is expected, so as not to have the literal be confused with a block statement.) Object initializers are expressions, and each object initializer results in a new object being created whenever the statement in which it appears is executed. Identical object initializers create distinct objects that will not compare to each other as equal. Objects are created as if a call to `new Object()` were made; that is, objects made from object literal expressions are instances of `Object`. @@ -385,7 +385,7 @@ const Manager = {   age: 27,   job: "Software Engineer" } -const Intern= { +const Intern = {   name: "Ben",   age: 21,   job: "Software Engineer Intern" @@ -403,7 +403,7 @@ Manager.sayHi() // Hello, my name is John' Intern.sayHi() // Hello, my name is Ben' ``` -The `this` refers to the object that it is in. You can create a new function called `howOldAmI()`which logs a sentence saying how old the person is. +The `this` refers to the object that it is in. You can create a new function called `howOldAmI()` which logs a sentence saying how old the person is. ```js function howOldAmI (){