If I have a number of functions that take json object parameters, does it make any difference whether I assign them to a variable before using them inside the function:
Function doSomething(data){
var abc = data;
abc.filter….etc.
}
Vs.
Function doSomething(data){
Data.filter….etc
}
is one way better than the other?
This makes no difference and it your example, the new variable is redundant. It is good practice not to create extra variables. It might be useful to do this if your JSON is heavily nested.
This will save you having to reference
data.foo.bar.bazall the time.