2022-01-01 게시 됨2022-01-01 업데이트 됨typescript몇 초안에 읽기 (약 60 단어)typescript keyof example.ts12345678910111213141516171819export type User = { name: string; email: string;};const user: User = { name: 'chinsung', email: 'chin_sung@naver.com',};// keyof User === 'name' | 'email'const updateUser = (name: keyof User, value: string) => { return { ...user, [name]: value, };};updateUser(''); // wow 자동완성!! 나이수 참고 https://www.typescriptlang.org/docs/handbook/2/keyof-types.html typescript keyofhttps://chinsun9.github.io/2022/01/01/typescript-keyof/AuthorchinsungPosted on2022-01-01Updated on2022-01-01Licensed under#typescriptkeyof