Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I just pulled up the page for String.match, which is a weird function because it returns an array that has named properties on it. W3Schools doesn't mention that. It just says it "method returns an array with the matches." It also doesn't mention the behavior without the global flag. I also noticed a misspelling ("Differense").

=> https://www.w3schools.com/jsref/jsref_match.asp

=> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Comparing these two pages, only the second one is competent at describing what the function actually does. Neither is perfect. The MDN doesn't do a great job of communicating all the information, but at least all of the information is there.



Can't we also issue PR against MDN?


Yes and they are very responsive about getting it merged in.


What?!

I think I've been using MDN for 20 years (I don't remember honestly when it first came to be), but it's first time I hear about it. Banner/link blindness is a hell of a thing! Thanks for letting me know.


Mozilla fired basically the entire MDN team with the rationaly that the "community" will pick up the slack with PRs and such

https://news.ycombinator.com/item?id=24132494

This was in 2020, I don't know if they eventually hired _someone_ to work on MDN


At the very bottom of the page is:

"Found a problem with this page?"

With a section on how to edit it.


Yes, and that's exactly what years of using MSDN and other similar documentation sites have taught me to be blind too.


For quite a while now MSDN has edit button that takes you to the source of the page on GitHub :)


Tangent: why is .match on Symbol? I read through string.match and looked at Symbol and I don’t understand why all these helpful functions exist on Symbol.


Symbol.match is not the match function, it is a Symbol which can be used as a property key on an object that is supposed to behave like a regular expression.

The purpose of having Symbol values is to ensure the property keys are unique and can't collide with string keys that predate new standards.



Ohhhh okay. So it’s just a flag describing expectations about an object. And as a Symbol it doesn’t interfere with any other part of the object such as properties or iteration.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: