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’
Thank you Portable Stick. That definitely helped me understand how to use push! Now to make my code recognize when a variable is not being passed through a function or is null how to delete the prop.
I’ve tried:
function updateRecords(id, prop, value) {
if (value === “”){
delete connection[id][prop]
}
but I can’t seem to make the function recognize that the value is blank or null, even when id and prop is provided. Any hints would be greatly appreciated. I’ve been stuck on this problem for days!