console.log("Hello World!");
/*const person={name:'Alex',
cars:['ferrari','alto'],
toString:()=>{console.log(`${name} has ${cars}`);}
}
person.toString();
*/
//the use of this
//cant use arrow function here wont work
const person={
name:'Alex',
cars:['ferrari','alto'],
// toString:function(){console.log(`${this.name} has ${this.cars}`)}
toString:function(){
this.cars.forEach((car)=>{console.log(`${this.name} has ${this.car}`)});
//that.cars
}}
//console.log(person);
person.toString();
//will work for es6