Skip to content

Latest commit

ย 

History

History
42 lines (34 loc) ยท 1.02 KB

File metadata and controls

42 lines (34 loc) ยท 1.02 KB

ES7(2016) ~ ES11(2020)

ES7

  • Array.prototype.includes
  • exponentiation (2 ** 2)

ES8

  • async/await
  • Object.entries()
  • Object.values()
  • Object.getOwnPropertyDescriptors()

ES9

  • async ๋ฐ˜๋ณต์ž
  • Object rest/spread ๋ฌธ๋ฒ•
  • Promise.prototype.finally -> ๋ฌด์กฐ๊ฑด ์‹คํ–‰

ES10

  • Array.prototype.flat()/flatMap()
  • Object.fromEntries() -> ๋ฐฐ์—ด๋กœ๋ถ€ํ„ฐ ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ฆ
  • String.prototype.trimStart()/trimEnd() -> ์•ž๋’ค ๊ณต๋ฐฑ ์ง€์šฐ๊ธฐ
  • Symbol.prototype.description
  • catch์˜ ์—๋Ÿฌ ์ธ์ž ์ƒ๋žต ๊ฐ€๋Šฅ

ES11

  • String.prototype.matchAll
  • Dynamic import
  • BigInt
  • Promise.allSettled
  • Optional Chaining -> ?.๋ฅผ ์‚ฌ์šฉํ•ด ํ”„๋กœํผํ‹ฐ์˜ ์กด์žฌ ์—ฌ๋ถ€ ํ™•์ธ
  • null ๋ณ‘ํ•ฉ ์—ฐ์‚ฐ์ž

null ๋ณ‘ํ•ฉ ์—ฐ์‚ฐ์ž

๋ณดํ†ต ๊ธฐ๋ณธ๊ฐ’์„ ํ• ๋‹นํ•˜๊ธฐ ์œ„ํ•ด ||๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ขŒ๋ณ€์ด null์ด๋‚˜ undefined๋ฉด ๋‹ค๋ฅธ ๊ฐ’์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹์„ ๋งŽ์ด ์‚ฌ์šฉํ–ˆ๋‹ค. ์ด๋ฅผ ??๋กœ ํ•ด๊ฒฐํ•˜์˜€๋‹ค.

const values = {
  nullValue: null
};

const value = values.nullValue ?? "default value";