/also to hide/encapsulate your details and to input details in either function invocation or using get/set/
function details (){ var name; var age;
for (var i=0; i<arguments.length; i++){ var arc = arguments[i]; if(typeof arg[0] !== "string") throw " invalid first argument ";
if(typeof arg[1]!==" number") throw "invalid second argument"; };
return {get: function () {return this.name+ " is " +this.age;}, set: function (name, age){ this.name = name; this.age = age;
}
var personal_details = details ();
personal_details.set(" Dreplica "," gg");
console.log(details())
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
/also to hide/encapsulate your details and to input details in either function invocation or using get/set/
function details (){
var name;
var age;
for (var i=0; i<arguments.length; i++){
var arc = arguments[i];
if(typeof arg[0] !== "string") throw " invalid first argument ";
if(typeof arg[1]!==" number") throw "invalid second argument";
};
return {get: function () {return this.name+ " is " +this.age;},
set: function (name, age){
this.name = name;
this.age = age;
}
}
}
var personal_details = details ();
personal_details.set(" Dreplica "," gg");
console.log(details())