Skip to content

Translate 1 file to ko - Keyof Type Operator.md #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bumkeyy
Copy link
Contributor

@bumkeyy bumkeyy commented Mar 5, 2022

0906747

리뷰 부탁드려요~

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2022

Thanks for the PR!

This section of the codebase is owned by @bumkeyy, @yeonjuan, @guyeol, and @dvlprsh - if they write a comment saying "LGTM" then it will be merged.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2022

Translation of Keyof Type Operator.md

title: Keyof Type Operator
layout: docs
permalink: /ko/docs/handbook/2/keyof-types.html

oneline: "Using keyof operators in a type context"

keyof Type operator

keyof The operator generates a number or string literal union of key values for an object in an object type.
The following type P is the "x" | It is the same type as "y".

type Point = { x: number; y: number };
type P = keyof Point;
//   ^?

If a type stringor number If you have an index signature, keyofreturns the type.

type Arrayish = { [n: number]: unknown };
type A = keyof Arrayish;
//   ^?

type Mapish = { [k: string]: boolean };
type M = keyof Mapish;
//   ^?

The highlight from the example above is Msilver string | numberit's a good idea. -- Because JavaScript object keys always force strings, obj[0]silver obj["0"]same as .

keyof Types are especially useful when used with mapped types that we will learn in the future.

Generated by 🚫 dangerJS against 0906747

@yeonjuan
Copy link
Contributor

LGTM

@github-actions github-actions bot merged commit 2578f65 into microsoft:main Sep 14, 2022
@github-actions
Copy link
Contributor

Merging because @yeonjuan is a code-owner of all the changes - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants