New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object.create commit #4545
Object.create commit #4545
Conversation
@amarachi-nwokocha Could you please sign this CLA, so that the entry can be reviewed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @amarachi-nwokocha
Thanks for your contribution at Codecademy!
I've listed some changes below. Could you please review and make them?
Also, you haven't signed the CLA yet. Please sign it.
Object.create(proto) | ||
Object.create(proto, propertiesObject) | ||
``` | ||
The **Object.create()** method creates a new object with the specified prototype object and properties. If no prototype is provided, the newly created object will have null as its prototype. This means that the newly created object will not inherit any properties or methods from any other object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the description of the Object.create() method, this should go at the start, before the ## Syntax.
Please modify the line: " The Object.create() method creates a new object with the specified prototype object and properties", since it is plagiarised.
Object.create(proto, propertiesObject) | ||
``` | ||
The **Object.create()** method creates a new object with the specified prototype object and properties. If no prototype is provided, the newly created object will have null as its prototype. This means that the newly created object will not inherit any properties or methods from any other object. | ||
The `propertiesObject` parameter is optional and allows you to add additional properties to the newly created object.You can specify which properties you want to add to the new object. For example, you might want to add a property called name, age, or anything else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular description should go just below the ## Syntax. Example:
Parameters:
prototype
: Its description
propertiesObject
: Its description
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave only a single line space.
|
||
// newObj inherits the greet function from prototypeObject | ||
console.log(newObj.greet()); // Output: "Hello!" | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave a line after this, and also use the following after leaving the line:
It produces the following output:
Hello!
// newObj inherits the greet function from prototypeObject | ||
console.log(newObj.greet()); // Output: "Hello!" | ||
``` | ||
in the example above, the `newObj` is created using `Object.create()` with `prototypeObject` as it's prototype. This gives it access to all of the methods on `prototypeObject` including the `greet()` function and that is why we have the final output of Hello from the console. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the example above, the `newObj` is created using `Object.create()` with `prototypeObject` as it's prototype. This gives it access to all of the methods on `prototypeObject` including the `greet()` function and that is why we have the final output of Hello from the console. | |
In the example above, the `newObj` is created using `Object.create()` with `prototypeObject` as its prototype. This gives it access to all of the methods on `prototypeObject` including the `greet()` function and that is why we have the final output of `Hello!` from the console. |
@amarachi-nwokocha |
Thanks for reviewing my pr, I will make the necessary changes today |
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
please review and let me know if i need to make any more changes thanks for the feedback i really appreciate it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @amarachi-nwokocha
Please follow the below structure and make the changes in the entry:
(1) Have the metadata (the title, description, tags, etc - I've already given a suggestion there, please go ahead and merge the same suggestion there)
(2) After the above table, give the description of the Object.create() method
(3) After this description use the ## Syntax block to show the syntax, and just after syntax describe the parameters.
(4) At the end, use the ## Example block along with output.
Please structure the entry as per the above instructions at your earliest convenience, then I will review it again.
Thanks!
…arameters.md Deleted the positional-parameters file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for the second review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
👋 @amarachi-nwokocha 🎉 Your contribution(s) can be seen here: https://www.codecademy.com/resources/docs/javascript/objects/create Please note it may take a little while for changes to become visible. |
Description
Issue Solved
Closes #4024
Type of Change
Checklist
main
branch.Issues Solved
section.