http://js2coffee.org/“rel=“nofollow”http://js2coffee.org/:
i = 0
len = keys.length
while i < len
k = keys[i]
mailOptions[k] = app.set("mailOptions")[k] unless mailOptions.hasOwnProperty(k)
i++
But I wouldn t do it this way. I would just do:
for k in keys
mailOptions[k] = app.set("mailOptions")[k] unless mailOptions.hasOwnProperty k
This outputs the following (excluding var
, which it also outputs):
for (_i = 0, _len = keys.length; _i < _len; _i++) {
k = keys[_i];
if (!mailOptions.hasOwnProperty(k)) {
mailOptions[k] = app.set("mailOptions")[k];
}
}
Or, if you wanted to be fancier, which I don t advise in this situation, since it sacrifices some readability:
(mailOptions[k] = app.set("mailOptions")[k] unless mailOptions.hasOwnProperty k) for k in keys