You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
keyof
관련된 문제입니다..! 🙇♂️개념 설명
keyof
는 객체의 모든 키를 문자열 또는 숫자 리터럴 유니온으로 가져올 수 있습니다. 즉, 객체의 속성 이름들을 타입으로 사용할 수 있게 해줍니다.객체의 모든 키를 가져오기 때문에 옵셔널 속성도 포함됩니다.
keyof
예시keyof Example
는"prop1" | "prop2"
가 됩니다.문제 예시
창고 정리
한 마을의 작은 창고에는 다양한 물건들이 쌓여있습니다. 연말을 맞이해서 창고를 정리하려고 합니다.
빠르게 정리하려면 창고에 어떤 항목이 있는지 파악해야 합니다.
창고 정리를 도와주세요.
"category" | "itemName" | "quantity" | "description"
"category" | "itemName" | "quantity"
정답
1번0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions