3 ms·
You certainly could have a separate function since this would need to know about the in-memory cache of the JSON versus pulling it from the URL. Or you could a
by BillSaysThis 11y ago
You certainly could have a separate function since this would need to know about the in-memory cache of the JSON versus pulling it from the URL.
Or you could also refactor the JSONTree function to (a) check if the first param is an object or string and (b) put the meet of the request eventListener (lines 24-35) into a separate function that's called as appropriate in each case.