I came across this code:
function extend(out){
out = out || {};
for (var i = 1; i < arguments.length; i++){
var obj = arguments[i];
if (!obj) continue;
for (var key in obj){
if (obj.hasOwnProperty(key))
out[key] = (typeof obj[key] === 'object') ? extend(out[key], obj[key]) : obj[key];
}
}
return out;
}
What does the line out = out || {};
mean and how does it work?
This function bascially combines different objects into one object.