반응형

​객체에 function 넣을수 있음. let tt = {tt:'1', func:function() ...} 
접근은 tt.func();  이런식임

 

//귀찮으니깐 샘플소스로 
const person = {
  firstName: "John",
  lastName : "Doe",
  id       : 5566,
  fullName : function() {
    return this.firstName + " " + this.lastName;
  }

};
반응형

+ Recent posts