Weaintfoundshit.js
11–20 of 22 posts
Re: Weaintfoundshit.js
#12Re: Weaintfoundshit.js
#13I don't understand at all. I clicked "I don't get it," then put ".arbitrary" in as a selector, and.....a message comes up saying "Wasn't that awesome?" Nothing else happened. What am I missing here
I believe it's a joke. At least I opened these comments thinking it was a joke akin to VanillaJS framework[1]. querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. [1] http://vanilla-js.com/
An empty NodeList[1] to be precise, which is sort of kind of like an array in that it has a length property and you can access its elements with index notation (`nodeList[0]`), but it doesn't inherit from Array.prototype, so it doesn't support methods like `forEach` or `map`.
[1] https://developer.mozilla.org/en-US/docs/Web/API/NodeList
Re: Weaintfoundshit.js
#14Re: Weaintfoundshit.js
#15Earlier quoted context omitted.
I believe it's a joke. At least I opened these comments thinking it was a joke akin to VanillaJS framework[1]. querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. [1] http://vanilla-js.com/
> querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. An empty NodeList[1] to be precise, which is sort of kind of like an array in that it has a length property and you can access its elements with index notation (`nodeList[0]`), but it doesn't inherit from Array.prototype, so it doesn't support methods like `forEach` or `map`. [1] https://develop…
Speaking of which, there are few features in ES2015 that make NodeList more palatable:
1. Iterables. NodeList is iterable and you can use, among others, the for..of construction to iterate over its content.
2. There is the Array.from method for turning array-like objects into true arrays. Not much different from our usual method of calling [].slice.call in this particular case, yet it's a bit shorter, standardized, and has a few additional perks, like accepting map function as the second argument.
Re: Weaintfoundshit.js
#16Earlier quoted context omitted.
I believe it's a joke. At least I opened these comments thinking it was a joke akin to VanillaJS framework[1]. querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. [1] http://vanilla-js.com/
> querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. An empty NodeList[1] to be precise, which is sort of kind of like an array in that it has a length property and you can access its elements with index notation (`nodeList[0]`), but it doesn't inherit from Array.prototype, so it doesn't support methods like `forEach` or `map`. [1] https://develop…
https://medium.com/@devlucky/nodelist-object-is-finally-an-i...
Re: Weaintfoundshit.js
#17Earlier quoted context omitted.
I believe it's a joke. At least I opened these comments thinking it was a joke akin to VanillaJS framework[1]. querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. [1] http://vanilla-js.com/
> querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. An empty NodeList[1] to be precise, which is sort of kind of like an array in that it has a length property and you can access its elements with index notation (`nodeList[0]`), but it doesn't inherit from Array.prototype, so it doesn't support methods like `forEach` or `map`. [1] https://develop…
Re: Weaintfoundshit.js
#18I don't understand at all. I clicked "I don't get it," then put ".arbitrary" in as a selector, and.....a message comes up saying "Wasn't that awesome?" Nothing else happened. What am I missing here
I believe it's a joke. At least I opened these comments thinking it was a joke akin to VanillaJS framework[1]. querySelectorAll returns an empty array if there are no matches, you don't need fancy string messages or errors for that. [1] http://vanilla-js.com/
Re: Weaintfoundshit.js
#19the mac keyboard shortcut listed should be Cmd+Option+i.