hi! I have been stuck on this problem for days now! Im not even that far into my javascript training and I am stuck. Yikes!
Ok, this is what I have so far:
function updateRecords(id, prop, value) {
if (collection[id].hasOwnProperty(prop)) {
return collection;
} else {
collection[id].push(prop);
collection[id][prop] = “”;
collection[id][prop] = (value);
return collection;
I am trying to take the property prop and push it to the end of the object if the property is not currently there. I keep getting this error and I’m not sure why… "TypeError: Object doesn’t support property or method ‘push’
Thanks for your help!