I’m trying to write a function that pushes ‘Waldo: unknown’ onto the end of an object. Can someone help me as to why ‘push’ isn’t working in this scenario.
here is my code
var addWaldo = (obj) => {
var element = {}
element['Waldo'] = 'unknown'
obj.push(element)
return obj
}