Skip to content

Latest commit

ย 

History

History
26 lines (21 loc) ยท 482 Bytes

ArrowFunction.md

File metadata and controls

26 lines (21 loc) ยท 482 Bytes
  • Arrow Function

    // ํ•จ์ˆ˜ ์„ ์–ธ์‹
    function gretting(x){
    	return x*x
    }
    
    // ํ•จ์ˆ˜ ํ‘œํ˜„์‹, ์ต๋ช…ํ•จ์ˆ˜
    const gretting = function(x){
    	return x*x
    }
    
    // ํ‘œํ˜„์‹, ์ฝœ๋ฐฑํ•จ์ˆ˜์˜ ๊ฒฝ์šฐ => ์‚ฌ์šฉ ๊ฐ€๋Šฅ
    const gretting = (x) => {
    	return x*x
    }
    
    // + ๋ณ€์ˆ˜๊ฐ€ ํ•˜๋‚˜์ธ ๊ฒฝ์šฐ ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ๊ด„ํ˜ธ ์ œ๊ฑฐ ๊ฐ€๋Šฅ
    const gretting = x=> {
    	return x*x
    }
    
    // { return ~~ } ๋„ ์ œ๊ฑฐ ๊ฐ€๋Šฅ
    const gretting = name => x*x