I'm still not very familiar with all the ES6 syntax, and I'm starting to learn Vue.js, which makes extensive use of it. So, I find something that puzzles me a bit:
What's the difference between these two methods?
const actions = {
foo1(num) {
console.log(num);
},
foo2: (num) => {
console.log(num);
}
}
actions.foo1(2);
actions.foo2(3);
// output: 2
// output: 3
I guess they are not the same, although they both output their passed value.