Reputation: 1
What type of object is container
?
var pname = "apples";
var extVal = "oranges";
var container = {};
container =
{
presName: pname,
presVal: pname
};
I want to compare the value of presVal
(from inside container
) to the value of extVal
.
But I'm not sure how to access presVal
to make this comparison.
Upvotes: 0
Views: 120
Reputation: 1725
you can access properties of an object by using a dot, or putting it in [] so in your question :
if (container.parsVal===extVal) { ... }
Upvotes: 4