Skip to content
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

Merged
merged 13 commits into from May 14, 2024
Merged

Conversation

amarachi-nwokocha
Copy link
Contributor

@amarachi-nwokocha amarachi-nwokocha commented Apr 19, 2024

Description

Issue Solved

Closes #4024

Type of Change

  • Adding a new entry
  • Editing an existing entry (fixing a typo, bug, issues, etc)
  • Updating the documentation

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@mamtawardhani mamtawardhani self-assigned this Apr 20, 2024
@mamtawardhani mamtawardhani added javascript JavaScript entries new entry New entry or entries status: under review Issue or PR is currently being reviewed labels Apr 20, 2024
@mamtawardhani
Copy link
Collaborator

@amarachi-nwokocha Could you please sign this CLA, so that the entry can be reviewed?

Copy link
Collaborator

@mamtawardhani mamtawardhani left a 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.

content/javascript/concepts/objects/terms/create/create.md Outdated Show resolved Hide resolved
content/javascript/concepts/objects/terms/create/create.md Outdated Show resolved Hide resolved
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.
Copy link
Collaborator

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.
Copy link
Collaborator

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

Comment on lines 26 to 27


Copy link
Collaborator

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.

content/javascript/concepts/objects/terms/create/create.md Outdated Show resolved Hide resolved

// newObj inherits the greet function from prototypeObject
console.log(newObj.greet()); // Output: "Hello!"
```
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

content/javascript/concepts/objects/terms/create/create.md Outdated Show resolved Hide resolved
@mamtawardhani
Copy link
Collaborator

@amarachi-nwokocha
Also Please make sure that you delete the positional-parameters.md file from here and create a different entry for that. Keep only create.md for this particular entry.

@amarachi-nwokocha
Copy link
Contributor Author

Thanks for reviewing my pr, I will make the necessary changes today

amarachi-nwokocha and others added 4 commits April 23, 2024 04:43
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
Co-authored-by: mamtawardhani <53176352+mamtawardhani@users.noreply.github.com>
@amarachi-nwokocha
Copy link
Contributor Author

please review and let me know if i need to make any more changes thanks for the feedback i really appreciate it

Copy link
Collaborator

@mamtawardhani mamtawardhani left a 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!

Copy link
Collaborator

@mamtawardhani mamtawardhani left a 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.

@Sriparno08 Sriparno08 self-assigned this May 13, 2024
Copy link
Collaborator

@Sriparno08 Sriparno08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

@Sriparno08 Sriparno08 merged commit 29d6441 into Codecademy:main May 14, 2024
6 checks passed
@Sriparno08 Sriparno08 added status: review 2️⃣ completed and removed status: under review Issue or PR is currently being reviewed labels May 14, 2024
Copy link

👋 @amarachi-nwokocha
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 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.
If you're appearing as anonymous and want to be credited, see here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Term Entry] JavaScript Objects .create()
3 participants