0
Q:

es6 functions

const obj = {
  foo() {
    return 'bar';
  }
};

console.log(obj.foo());
// expected output: "bar"
1
const add = (n1, n2) => n1 + n2
1

hello = () => {
  return "Hello World!";
} 
8
multiplyfunc = (a, b) => { return a * b; }
2
const plantNeedsWater = day => day === 'Wednesday' ? true : false;

//If only 1 Parameter no () needed
//Single line return is implicit
//Single line no {} needed
0

New to Communities?

Join the community