➤ Supabase➤ Scala➤ Github➤ React Native➤ projectdiscovery➤ Remix➤ Rescript➤ Purescript➤ npm➤ Cloudflare➤ React➤ Next.js➤ GO➤ Hyper-V➤ Tibero➤ Git➤ Algorithms, 2020년
Docs. Type
February 22, 2022Type
Inference
타입을 작성하지 않아도 유추된다.
// (int,int) => int
let add = (a, b) => a + b
Type Annotation
타입을 적어줄 수도 있다. 타입 어노테이션이 유추한 타입과 맞지 않는 경우 컴파일 에러가 난다.
let score: int = 10
// This has type: int Somewhere wanted: string
// let name:string = 10
어떤 표현도 ()
에 넣고 어노테이션을 사용할 수 있다.
let myScore = (5: int) + 10