Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include null and undefined elements in flat() example (#36095)
* Include null and undefined elements in flat() examples - I wasn't sure if `null`, `undefined`, and "empty" were equivalent in the eyes of the `flat()` method, so I tried it out in the console and learned that they are not. - I've modified the example for sparse arrays to include these values so that others don't have to run their own experiments to learn this information. - I also included a link to the sparse array documentation. If the way `flat()` handles `null` and `undefined` confuses the reader, I think they are likely to click on this link to educate themselves. * In flat() docs, change "ignore empty slots" to "remove empty slots" - I noticed that a later example uses the phrase "remove empty slots" in its language, otherwise I wouldn't have made this PR: - I think the "ignore" in "ignore empty slots" may be more technically correct, but "remove empty slots" paints a clearer picture and is harder to misinterpret. "Ignoring" an element could have meant it is returned without modification.
- Loading branch information