Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TypeScript リテラル型について

Kosuke Ogawa
September 18, 2020

TypeScript リテラル型について

Webナイト宮崎 Vol.10 ~てげTypeScriptを学びたい~ - connpass https://tegehoge.connpass.com/event/186724/

Kosuke Ogawa

September 18, 2020
Tweet

More Decks by Kosuke Ogawa

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ w 0HBXB,PTVLFʢ!LPPHBXBʣ w Ξϧגࣜձࣾʢ౦ژʣ w ٶ࡚͔ΒϑϧϦϞʔτ w J04 4XJGU

    "OESPJE ,PUMJO 5ZQF4DSJQU $44 7VFKT /VYUKTͳͲ w ࠷ۙ͸ϑϩϯτΤϯυ͕ϝΠϯ
  2. • 6 ΍ 2000 ͔͠ڐ͞Εͳ͍ܕ • จࣈྻͷϦςϥϧܕ΋͋Δ • const b:

    'bar' = 'foo'; // Τϥʔ: Type '"foo"' is not assignable to type ‘"bar"'. Ϧςϥϧܕͱ͍͏Β͍͠