arrow function

This commit is contained in:
Tyrel Souza 2017-12-01 00:32:51 -05:00
parent 11cd3b5b68
commit fedd8c6c2c
1 changed files with 17 additions and 0 deletions

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);