3 ms·
I this awesome... I've always done Array.from(new Array But your approach makes perfect sense and is so much cleaner. Thank you! If anyone is wondering why it
by warent 6y ago
I this awesome... I've always done Array.from(new Array
But your approach makes perfect sense and is so much cleaner. Thank you!
If anyone is wondering why it works, it's because everything in JavaScript is an object. So, an array is an object with a length prop. Apparently Array.from just needs any object with a length prop to work
- kvirani 6y agoSomething about ducks?
- chpmrc 6y ago"If it walks like a duck, and it quacks like a duck, then it must be an object"
- erhk 6y agoOf it has feathers, then as far as I'm concerned it is a duck. Similarly, when I pick up a feathered pen in real life I become a duck
- DonHopkins 6y ago"If it walks like a duck, and it quacks like a duck, then it must be created by a QuackEnumeratorWalkManangerRepositoryProxyFactoryFactoryAdapterBroker." -Java
- chmod775 6y agoduckduckduck.duck is still available, by the way. Well, .duck isn't a TLD yet and it may not be publicly available... https://icannwiki.org/.duck https://icannwiki.org/.duck
- Freak_NL 6y agoNow gogo.duck and go.duck would be nice aliases for DuckDuckGo. (There is ddg.gg of course.)