0
Imagine the following situation:
I have several "classes" built from javascript functions where their properties are defined within the constructor. So:
var Pessoa = function(data) {
this.nome = arguments[0].nome || '';
this.telefone = arguments[0].telefone || '';
... // n parâmetros ...
this.email = arguments[0].email || '';
};
The use of property arguments[0]
is used to send an object with all the properties that will be set for that Person class. Is there any way I can return all the properties I have inside the constructor of this classe
?
As far as I understand Javascript, I probably wouldn’t be able to do that natively. Therefore, using a prototyped function, how can I return all parameters defined within my constructor?