Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript casting objects

class Person {
  constructor(obj) {
    obj && Object.assign(this, obj);
  }

  getFullName() {
    return `${this.lastName} ${this.firstName}`;
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #casting #objects
ADD COMMENT
Topic
Name
6+2 =