ES (ECMAscript)

  • Caution

    let: ์žฌ ํ• ๋‹น ๊ฐ€๋Šฅ / const: ์žฌํ• ๋‹น ๋ถˆ๊ฐ€๋Šฅ !== ๊ฐ’์ด ๋ฐ”๋€Œ์ง€ ์•Š์Œ.

    Function => 1๊ธ‰ ๊ฐ์ฒด

    ๋ณ€์ˆ˜(var)๋‚˜ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ์•ˆ์— ๋‹ด์„ ์ˆ˜ ์žˆ๋‹ค

    ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ์ „๋‹ฌ ํ•  ์ˆ˜ ์žˆ๋‹ค (ํ•จ์ˆ˜์˜ ์ธ์ž)

    ๋ฆฌํ„ด ๊ฐ’์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค

    ์ ˆ๋Œ€ ๋Š์Šจํ•œ ์ผ์น˜ ์—ฐ์‚ฐ์ž (==, !=)๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค | ===, !==

    Can't ~~ js๋Š” ๋ฌธ์žฅ๋„์šด๊ฒƒ์„ ํ•ฉ์ณ ๋ณด๊ธฐ ๋•Œ๋ฌธ์— ; ๊ฐ€ ์—†์–ด์„œ ์—๋Ÿฌ ๋‚  ์ˆ˜ ์žˆ๋‹ค

  • console.log() : ์ฝ˜์†”์ฐฝ์— ๋ฉ”์‹œ์ง€๋ฅผ ์ถœ๋ ฅ

  • ์š”์†Œ(querySelctor'์žก์€' / createElement'๋งŒ๋“ ')๋ฅผ ์ž˜ ๋งŒ๋“ค์–ด์„œ(innerText or innerHTML) ๋ถ™์ธ๋‹ค.(Node.append() or appendchild())

  • callback function

    • array helper method -> callback function (for ์ด๋ฒคํŠธ๋ฆฌ์Šคํ„ฐ of DOM / 1๊ธ‰๊ฐ์ฒด)

      A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.

    • map(): ๊ฐ value๊ฐ€ ์ธ์ž ์ž๋ฆฌ์— ๋“ค์–ด๊ฐ€ ๋ฆฌํ„ด๋œ ๊ฐ’์„ ์ƒˆ๋กœ์šด ๋ฐฐ์—ด์— ๋„ฃ์–ด ๋ฆฌํ„ดํ•จ

    • forEach(): ์ธ์ž์— value๋“ค์„ ๋ฐ›์•„ ๋„˜๊ฒจ์ฃผ๊ณ  ๋, ๋ฆฌํ„ด์—†์Œ

    • Filter(): ๋ฆฌํ„ด์ด true์ธ value๋“ค๋งŒ ๋ชจ์•„ ์ƒˆ๋กœ์šด ๋ฐฐ์—ด๋กœ ๋ฆฌํ„ด

  • This

    this ๊ฐ€ window๊ฐ€ ์•„๋‹Œ ๊ฒฝ์šฐ,method ์•ˆ์˜ this -> ํ•ด๋‹น method๊ฐ€ ์ •์˜๋œ ๊ฐ์ฒด(object)์ƒ์„ฑ์ž ํ•จ์ˆ˜ ์•ˆ์˜ this

Last updated