Open web-bert opened 10 years ago
Not sure really...
Either we default it as is or it will naturally throw an error when el is undefined. Wouldn't need scaffolding for that one although you could - but then it would be the same piece of scaffolding on 75% of the functions.
I would take that out as the first argument should not be optional.
Thanks!
There ya go - it's certainly not nice to do getElementsByClassName(, "className")
Should rendition1 actually default to document when no el is passed - or just throw an error?
https://github.com/rassie/jessie/blob/master/functions/getDescendantsByClassName/rendition1.js#L12
This has just caught me out, as some code was expecting to get some descendants by class, but instead it got the whole documents elements. And I didn't notice until the tester pointed it out, where as if it threw an error then I would have known before checking it in.