• 2cts: I would not call the parm in the callback err. I'd rather call it somthing like status or info or ...

    If returning 0 (zero), or null, or undefined as the only ok values, that works with easy check of negation. If something bad happened, an error object should be returned if there is more information than just a scalar. Returning a simple scalar for error and having to go back and ask for the error is an option, but it costs memory, if the error is not already an anyway-available status property.

    Furthermore, I'd prefer an object over a list of parameters.

    My comments should be taken with the grain of Espruino salt, because for a resource tight environment other considerations than just object-orientation apply.

About

Avatar for allObjects @allObjects started