What is this?
en4.activity.like(c)
Is this a function like() of property 'activity' of object en4?
I need to re-write the function but in the same format and I'm confused.
This would do the job:
var en4 = {
activity: {
like: function(c) {
}
}
};
In case en4 already exists and also has a property activity you'd do it like this:
en4.activity.like = function(c) {
...
};
If that property also doesn't exist:
en4.activity = {
like: function(c) {
}
};
Since you just have a single object there is most likely no need to involve prototypes at all.
en4 exists but has no property activity, does the last example still work?
en4? Is this an instance or an object (direct instance of an object)?