I have a code snippet of JavaScript:
mf.profile.push({
"Site": {
"Name": "Jack Montana",
"Identity": 61026032,
"Email": "[email protected]",
"Phone": "+14155551234",
"Gender": "M",
}
});
mf.event.push("Product viewed", {
"Product name": "Casio Chronograph Watch",
"Category": "Mens Accessories",
"Price": 59.99,
"Date": new Date()
});
Now my question is what does mf.profile.push or mf.event.push signify?
Is mf an object and profile a function? or both are classes and push is a function?
mfis an object, thatmf.profileandmf.eventare objects and thatmf.profile.pushandmf.profile.pushare functions. However, any value that is not a primitive value is an object. Arrays are objects and so are functions. Any of the values that I identifier as "objects" could also be arrays or functions.