Skip to content

Update "Working with objects"#10724

Merged
wbamberg merged 3 commits intomdn:mainfrom
alattalatta:js/guide/working_with_objects
Nov 24, 2021
Merged

Update "Working with objects"#10724
wbamberg merged 3 commits intomdn:mainfrom
alattalatta:js/guide/working_with_objects

Conversation

@alattalatta
Copy link
Copy Markdown
Member

@alattalatta alattalatta commented Nov 23, 2021

Summary

Fixed and updated the doc here and there.

Motivation

  • Code blocks don't comply MDN code formatting rules, such as missing semi and things.
  • Code uses var, changed to let and const.
    • Didn't use const to avoid having to explain here why a const object properties can be changed... Which I think can be confusing. 🤔
  • A few sentences are out of its place, such as line 156. (upstream)
  • Some links are outdated.

Supporting details

Related issues

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@alattalatta alattalatta requested a review from a team as a code owner November 23, 2021 16:59
@alattalatta alattalatta requested review from sideshowbarker and removed request for a team November 23, 2021 16:59
@github-actions github-actions bot added the Content:JS JavaScript docs label Nov 23, 2021
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 23, 2021

Preview URLs

Flaws

URL: /en-US/docs/Web/JavaScript/Guide/Working_with_Objects
Title: Working with objects
on GitHub
Flaw count: 1

  • broken_links:
    • No need for the pathname in anchor links if it's the same page

External URLs

URL: /en-US/docs/Web/JavaScript/Guide/Working_with_Objects
Title: Working with objects
on GitHub

No new external URLs

(this comment was updated 2021-11-24 02:38:15.023221)

Copy link
Copy Markdown
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thanks @alattalatta , this is a good improvement!

I had one very minor comment. I would merge this PR even without it being addressed but please accept it if you agree. On this:

  • Didn't use const to avoid having to explain here why a const object properties can be changed... Which I think can be confusing. 🤔

I agree that const can be confusing, mostly because it is badly taught. For that reason I think it's important to use it consistently in our docs and explain it clearly from the start.

We discussed this issue recently: https://github.com/mdn/content/discussions/10389 and agreed to use const in situations like this.

But I'd merge this PR anyway because it's much better than what was there before.

@alattalatta alattalatta requested a review from wbamberg November 24, 2021 02:36
Copy link
Copy Markdown
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Very nice cleanup. Thank you @alattalatta !

@wbamberg wbamberg merged commit 18b43cb into mdn:main Nov 24, 2021
@alattalatta alattalatta deleted the js/guide/working_with_objects branch November 24, 2021 04:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Content:JS JavaScript docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants