Thank you so much for answering my question.
Var plugins, is an array that contains all type objects; With loop for, check if my target matches one of those in the array plugins.
It is not very clear though what makes $ (target) .data (plugins
).
I insert a control into loop for:
for(var i=plugins.length-1; i>=0; i--){
var ctrl = $(target).data(plugins[i]);
console.log(i + " TARGET " + target + " is PLUGIN " + plugins[i] + "? " + ctrl);
if (ctrl){
return plugins[i];
}
}
The answer to each call is indefinite, except in the right case, which returns [object, Object]
Thanks