[ES6] Arrow Function 같지만 다른 표현법

ShiHoon Yoon·2020년 9월 10일
0

3가지 Examples. 모두 같은 기능.

const a = (who) => "hello " + who + "!";
const b = (who) => (
    "hello " + 
    who + 
    "!"
);
const c = (who) => {
  return "hello " + who + "!";
}; 
const x = () => {} // Does nothing
const y = () => ({}) // returns an object
profile
Entrepreneurs Should Learn to Code

0개의 댓글