Missing Doc: Array.prototype.join calls toString internally #27134
Labels
Content:JS
JavaScript docs
help wanted
If you know something about this topic, we would love your help!
MDN URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join
What specific section or headline is this issue about?
Examples
What information was incorrect, unhelpful, or incomplete?
We should demonstrate an example where we tell the readers that if there are nested arrays as items of an array variable If we call the
join
method on the variable it will internally calltoString
on the nested array item with,
as a delimiter. This will return a flattering array ( which may confuse the users if their delimiter is also comma,
), for example belowCode snippet
output:
"h,e,l,l,o,w,o,r,l,d"
What did you expect to see?
Examples like this can be really helpful if someone is a beginner and it can help people during dev or code reviews.
Do you have any supporting links, references, or citations?
Under the spec:
https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.join
Read point
7.b
Do you have anything more you want to share?
If we all agree on this, I'm happy to raise an MR.
The text was updated successfully, but these errors were encountered: