Typescriptμ λν μμ½μ΄ λͺ©λ‘μ΄ μ΄λκ°μ μμ΅λκΉ? λλ λλ¬ λ³΄μμ§λ§ μΈμ΄ μ¬μ μμλ μ°Ύμ μ μμμ΅λλ€.
ES6 μ¬μμ μ°Έμ‘°νμ¬ λΆλΆ λͺ©λ‘ μ νμ ν μ μμ§λ§ νμ¬ λͺ©λ‘ μ μ½λλ‘ μ§μ μ΄λνλ κ²μ΄ λ λμ μ μμ΅λλ€. TS μ¬μ (@ahejlsberg)μ μΌλΆλ‘ μ 체 λͺ©λ‘μ μ μ§νλ κ²μ΄ μ’μ΅λλ€.
μ½λλ₯Ό κΈ°λ°μΌλ‘ λ€μκ³Ό κ°μ΄ μ 리νμ΅λλ€.
| μμ½μ΄ | Strict λͺ¨λ μμ½μ΄ | λ¬Έλ§₯ ν€μλ |
| --- | --- | --- |
| break
| as
| any
|
| case
| implements
| boolean
|
| catch
| interface
| constructor
|
| class
| let
| declare
|
| const
| package
| get
|
| continue
| private
| module
|
| debugger
| protected
| require
|
| default
| public
| number
|
| delete
| static
| set
|
| do
| yield
| string
|
| else
| symbol
| |
| enum
| type
| |
| export
| from
| |
| extends
| of
| |
| false
| | |
| finally
| | |
| for
| | |
| function
| | |
| if
| | |
| import
| | |
| in
| | |
| instanceof
| | |
| new
| | |
| null
| | |
| return
| | |
| super
| | |
| switch
| | |
| this
| | |
| throw
| | |
| true
| | |
| try
| | |
| typeof
| | |
| var
| | |
| void
| | |
| while
| | |
| with
| | |
λ μ½κ² 볡μ¬νλ €λ©΄ λ€μμ μννμμμ€.
| μμ½μ΄ |
| --- |
| break
|
| case
|
| catch
|
| class
|
| const
|
| continue
|
| debugger
|
| default
|
| delete
|
| do
|
| else
|
| enum
|
| export
|
| extends
|
| false
|
| finally
|
| for
|
| function
|
| if
|
| import
|
| in
|
| instanceof
|
| new
|
| null
|
| return
|
| super
|
| switch
|
| this
|
| throw
|
| true
|
| try
|
| typeof
|
| var
|
| void
|
| while
|
| with
|
| Strict λͺ¨λ μμ½μ΄ |
| --- |
| as
|
| implements
|
| interface
|
| let
|
| package
|
| private
|
| protected
|
| public
|
| static
|
| yield
|
| λ¬Έλ§₯ ν€μλ |
| --- |
| any
|
| boolean
|
| constructor
|
| declare
|
| get
|
| module
|
| require
|
| number
|
| set
|
| string
|
| symbol
|
| type
|
| from
|
| of
|
λν namespace
, μλ§λ async
λ° await
.
@DanielRosenwasser λ μν€ νμ΄μ§κ° μμ΄μΌν©λλ€.
Typescript Playground μμ μ¬κΈ°μ μΈκΈ λ λͺ κ°μ§ μλΉ λ¨μ΄λ₯Ό μλνμ§λ§ λ¬Έμ κ° λ°μνμ§ μμμ΅λλ€. IMO, ν€μλλ μ μ΄λ ES6μ ν€μλμ μΌμΉν΄μΌν©λλ€. λμ€μ MDN μ¬μ΄νΈμμ λ§λ λͺ©λ‘ μΈ https://github.com/crissdev/is-keyword-js/blob/master/index.js λͺ©λ‘μ΄ μμ΅λλ€.
@chinhodado @crissdev Typescript νΈλλΆμμ ν€μλ νμ΄μ§λ₯Ό λ§λ€λ €λ©΄ PRμ μ°Έμ‘°νμμμ€.
κ°μ₯ μ μ©ν λκΈ
ES6 μ¬μμ μ°Έμ‘°νμ¬ λΆλΆ λͺ©λ‘ μ νμ ν μ μμ§λ§ νμ¬ λͺ©λ‘ μ μ½λλ‘ μ§μ μ΄λνλ κ²μ΄ λ λμ μ μμ΅λλ€. TS μ¬μ (@ahejlsberg)μ μΌλΆλ‘ μ 체 λͺ©λ‘μ μ μ§νλ κ²μ΄ μ’μ΅λλ€.
μ½λλ₯Ό κΈ°λ°μΌλ‘ λ€μκ³Ό κ°μ΄ μ 리νμ΅λλ€.
| μμ½μ΄ | Strict λͺ¨λ μμ½μ΄ | λ¬Έλ§₯ ν€μλ |
| --- | --- | --- |
|
break
|as
|any
||
case
|implements
|boolean
||
catch
|interface
|constructor
||
class
|let
|declare
||
const
|package
|get
||
continue
|private
|module
||
debugger
|protected
|require
||
default
|public
|number
||
delete
|static
|set
||
do
|yield
|string
||
else
|symbol
| ||
enum
|type
| ||
export
|from
| ||
extends
|of
| ||
false
| | ||
finally
| | ||
for
| | ||
function
| | ||
if
| | ||
import
| | ||
in
| | ||
instanceof
| | ||
new
| | ||
null
| | ||
return
| | ||
super
| | ||
switch
| | ||
this
| | ||
throw
| | ||
true
| | ||
try
| | ||
typeof
| | ||
var
| | ||
void
| | ||
while
| | ||
with
| | |λ μ½κ² 볡μ¬νλ €λ©΄ λ€μμ μννμμμ€.
| μμ½μ΄ |
| --- |
|
break
||
case
||
catch
||
class
||
const
||
continue
||
debugger
||
default
||
delete
||
do
||
else
||
enum
||
export
||
extends
||
false
||
finally
||
for
||
function
||
if
||
import
||
in
||
instanceof
||
new
||
null
||
return
||
super
||
switch
||
this
||
throw
||
true
||
try
||
typeof
||
var
||
void
||
while
||
with
|| Strict λͺ¨λ μμ½μ΄ |
| --- |
|
as
||
implements
||
interface
||
let
||
package
||
private
||
protected
||
public
||
static
||
yield
|| λ¬Έλ§₯ ν€μλ |
| --- |
|
any
||
boolean
||
constructor
||
declare
||
get
||
module
||
require
||
number
||
set
||
string
||
symbol
||
type
||
from
||
of
|