3 ms·
But what happens in the case where there is no author element? With normal javascript you would get an exception .. hopefully with this you just get back undef
by aquark 15y ago
But what happens in the case where there is no author element?
With normal javascript you would get an exception .. hopefully with this you just get back undefined without having to check every step in the path.
- lloydhilaiel 15y agowith the reference implementation: JSONSelect.match(".nonexistantkey .somechild", obj) returns [] Alternately, if you use the JSONSelect.forEach() method your callback will just not be invoked. So no existence testing before access for recursive values. A main benefit of this thing in javascript.