Skip to content

Conversation

@DanKaplanSES
Copy link
Contributor

@DanKaplanSES DanKaplanSES commented Mar 29, 2025

Description

Use Object.hasOwn on undefined and null property values

Motivation

  • In my experience, the output of Object.hasOwn on undefined/null property values can be unexpected, so I wanted to document it in the example.

Additional details

Related issues and pull requests

- In my experience, the output of `Object.hasOwn` on `undefined`/`null` property values is unexpected, so I wanted to document it in the example.
@DanKaplanSES DanKaplanSES requested a review from a team as a code owner March 29, 2025 18:50
@DanKaplanSES DanKaplanSES requested review from Josh-Cena and removed request for a team March 29, 2025 18:50
@github-actions github-actions bot added Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed labels Mar 29, 2025
@github-actions
Copy link
Contributor

@Josh-Cena
Copy link
Member

Thanks. This is an interactive example, whose goal is to offer a quick taste of the API, not every aspect of its functionality. We demonstrate three things here: an existing own property, an existing property on the prototype, and a nonexistent property, which is more than enough to cover the whole algorithm anyway. I agree we should have examples demonstrating nullish properties, but they should go into the actual example section.

@Josh-Cena
Copy link
Member

Actually we already have examples for these below. Thanks for the PR!

@Josh-Cena Josh-Cena closed this Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants