4 ms·
Darn, that's what you get from typing on mobile. Ment to use querySelectorAll originally. But apart from null handling (which can be solved using `|| []`), what
by 9dev 8y ago
Darn, that's what you get from typing on mobile. Ment to use querySelectorAll originally. But apart from null handling (which can be solved using `|| []`), what else would be lacking? I used a similar version of this for a few projects a while back, with some additional stuff for query context and ID selector -> getElementById I think, but that's basically it...
- fenwick67 8y agoIt definitely works, I've written `document.querySelectorAll(x)||[]` many times. If all you're doing is making a few simple queries, it works fine.