3 ms·
The biggest issue with this is that the developer did not read the documentation on the JavaScript Array prototype from MDN. If you internet search "mdn array"
by devilsdata 1y ago
The biggest issue with this is that the developer did not read the documentation on the JavaScript Array prototype from MDN.
If you internet search "mdn array", you get the following as the first result:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Then `⌘F`/`Ctrl-F` "reverse", the first result will be a link to this page:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
The second result will give the non-mutating ES6 version:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toReversed https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Hell, even internet searching "mdn array reverse" will give you `reverse()` as the first result.
---
I genuinely find it concerning that it takes 20 minutes of "Googling" for the "Senior Developer" to work out something that is easily findable in the documentation.
It's especially worrying that they are then advising junior developers to do the exact same thing.
I appreciate that the author is trying to be encouraging. That's valuable, and we need more of it in this industry at the moment. But advising people that it's okay to avoid reading the documentation first is bad advice, in my opinion.