I’m often finding myself passing around a lot of parameters from function to function. Looks like this:
ajaxLiveUpdate : function (bindTo, func, interval, dyn, el, lib_template, locale, what) { // do sth }
While I could see that storing these in an object specs
would make sense “visually” I’m curious as to the performance implications of creating the object, assinging all the key/val pairs and passing the object around.
Question:
If every ms counts, what is the best and most structured way to shuffle around a large number of function parameters?
Thanks!
Answer
I think a good optimizer would make this micro-optimization insignificant. Feel free to use whichever suits your coding style and code reading habits better. If you prefer an object, because it’s more compact, go ahead and use an object. If you’d rather spell out arguments expressly, then do that.