I’m learning JavaScript and I’m trying to understand objects. I’m learning from a site that doesn’t really explain things well (or I’m just oblivious to the examples given) and need some help.
I need to edit this function such that it takes in an object as a parameter. Return the ‘abc’ property from that object.
Well you are taking this too literally here. :-) The “key” usually refers to the name of the object property, and “value” to the value that property holds. So what you are after is most probably this:
var myObject = { abc: true }
You can also add properties later on:
var myObject = {}
myObject.abc = true
You can read all you need to know in the article Working with objects over at the MDN.