jQuery.each(player, function(key, val){
if (el = $("#pr_attr_plain_"+key)){
el.text(val === "" ? 0 : " " + val);
}
});
I inherited a project and I came across something strange. The guy who started the project is an expereinced programmer, definitely more so then myself. Is there any value or reason (no matter how bad) in doing this:
if (el = $("#pr_attr_plain_"+key))
It works now and it’s in a portion of the code that I don’t have to touch. I don’t want to change it and have it produce unexpected consequences without knowing what it might do.
It can be correct.
The code is equivalent to: