function shallowClone(obj) {
    let result = {};
    for (let p in obj) {
        if (obj.hasOwnProperty(p)) {
            result[p] = obj[p];
        }
    }
    return result;
}
clones the given object's properties shallowly, ignores properties from prototype
@param obj the object to clone
@return the cloned object