0 points

Constructor Function


dashboard

Tue Sep 08 2020 23:26:25 GMT+0000 (UTC)

Posted by @dgaldon #javascript

function User(name) {
  this.name = name;
  this.isAdmin = false;
}

let user = new User("Jack");
content_copy Copy

https://stackoverflow.com/questions/8698726/constructor-function-vs-factory-functions