I'm just getting to know the whole prototype world, and now I'm trying to do in JS what is normally done in OO languages, namely classes and DAO classes.I'd be grateful for any comments on whether the code is written in accordance to JS best practices and whatnot. More specifically, I didn't implement getters or setters per se, is my approach still sound?function Person(obj) {  this.id = obj.id;  this.name = obj.name;  this.surname = obj.surname;}Person.prototype.toString = function(){  return [+this.id+] name:  + this.name + , surname:  + this.surname;};/*Field.prototype = {    get value(){        return this._value;    },    set value(val){        this._value = val;    }};*/function PersonDAO(){   this.arrayOfPeople = []; }PersonDAO.prototype = {  save:function(personObj){    this.arrayOfPeople.push(personObj);  },  getAll:function(){    return this.arrayOfPeople;  }};var John = new Person({  id: 1,  name: John,  surname: Smith});var Bob = new Person({  id: 2,  name: Bob,  surname: Doe});var pDAO = new PersonDAO();pDAO.save(John);pDAO.save(Bob);console.log(pDAO.getAll()[0].toString());
JavaScript - prototype, getters, setters, functions
javascript