Can you help me to understand ES6 and Object ?
class Contact{
constructor(name,tel,mail)
this.name=name;
this.tel=tel;
this.mail=mail;
method1(){
//code
}
}
If I want create a contact I can use
const me = new Contact('David','070809112','10 street of Paris')
But I'm not able to use Object.create() before ES6 I can use Object.create() with ES6 Ican't can you help me ?
BEFORE ES6
var Contact ={
init:function('name','tel','mail')
this.name=name;
this.tel=tel;
this.mail=mail;
method1 : function(){
//code
}
}
var me = Object.create(Contact);
me.init('David','070809112','10 street of Paris');
In this case How use Object.create() ? for create a new contact. Thanks