In the code:
slider.init({
foo: "bar"
});
var slider={
init:function(data){
}
}
If I use data.foo, I will get "bar".
Supposing I have an optional variable called fish which can be included in the JSON variable. If I reference data.fish, I will be told that it is undefined or an error will be thrown or something. Is there a way that I can assign a default value to fish so that when I request data.fish, even though it is not set in the parameter, I will get a default value?