5
I have seen this structure lately, in javascript, tried to search about it but could not get concrete answers. I know it is an Object -I think- but it is that I am beginner and did not understand how it works. Mainly the beginning -var PROD {};??.
var PROD = {};
PROD.clients = {
init: function(){},
method1: function(){}
};
PROD.pages = {
init: function(){},
method1: function(){}
};
PROD.accounts = {
init: function(){},
method1: function(){}
};
Is it practically an object orientation? Say this is a model with only the functions? If you wanted you could put an attribute and this method1 would inform a value in it, as if it were a set?
– Giancarlo Abel Giulian
Yes, that’s right. You don’t need to define all the members of the object as functions. You can set as variables.
– Leonel Sanches da Silva