Open drizzle96 opened 1 month ago
type Includes<T extends readonly any[], U> = {
[P in T[number]]: true
}[U] extends true ? true : false;
type Includes<T extends readonly any[], U> =
T['length'] extends 0 ? false
: Equal<U, T[0]> extends true ? true
: T extends [any, ...infer R] ? Includes<R, U> : false;
Includes
![#array](https://img.shields.io/badge/-%23array-999)
JavaScript์
Array.includes
ํจ์๋ฅผ ํ์ ์์คํ ์์ ๊ตฌํํ์ธ์. ํ์ ์ ๋ ์ธ์๋ฅผ ๋ฐ๊ณ ,true
๋๋false
๋ฅผ ๋ฐํํด์ผ ํฉ๋๋ค.์์: