I remember coming across the solution for this problem.. There is a special term for this type of argument if I am not wrong.. But I just can’t remember exactly what it is. I try searching for it on the web but to no avail.. So here it comes:
I want to pass an argument that consists of a function. What should I do?
function meow(cat){
var z = $("#nyan").position().cat;
alert(z);
}
meow(left);
or
function meow(cat){
var z = $("#nyan").cat();
alert(z);
}
meow(height);
That’s not quite a function; it looks more like you want a name of a property.
I’m just going to throw a few suggestions at you and see which one you like the most.
… or …
… or, really using a function:
Edit: the most important thing is that
a.bis equivalent toa["b"]—note the quotes in the latter.So if you want
a.xifwidthistrueora.yifwidthisfalse, for example: