arrow function

This commit is contained in:
Tyrel Souza 2017-12-01 00:32:51 -05:00
parent 11cd3b5b68
commit fedd8c6c2c

View File

@ -0,0 +1,17 @@
var square = x => x * x;
console.log(square(9));
var user = {
name: "Tyrel",
sayHi: () => {
console.log(arguments);
console.log(`Hi I'm ${this.name}.`);
},
sayHiAlt () {
console.log(arguments);
console.log(`Hi I'm ${this.name}.`);
}
}
user.sayHi(1,2,3);
user.sayHiAlt(1,2,3);