-
Notifications
You must be signed in to change notification settings - Fork 132
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
Translate 1 file to ko - Narrowing.md #131
base: main
Are you sure you want to change the base?
Conversation
Translation of Narrowing.mdtitle: Narrowing oneline: "I understand how TypeScript uses JavaScript knowledge to remove large amounts of type grammar from a project."
function padLeft(padding: number | string, input: string): string {
throw new Error("Not implemented yet!");
}
// @errors: 2345
function padLeft(padding: number | string, input: string) {
return " ".repeat(padding) + input;
} Oh my god function padLeft(padding: number | string, input: string) {
if (typeof padding === "number") {
return " ".repeat(padding) + input;
}
return padding + input;
} If this JavaScript code doesn't seem funny, you're looking at it correctly. It rather than seems like a big deal, but there's actually a lot going on here.
function padLeft(padding: number | string, input: string) {
if (typeof padding === "number") {
return " ".repeat(padding) + input;
// ^?
}
return padding + input;
// ^?
} To understand TypeScript narrowing, there are a few different structures that you need to know.
|
LGTM |
There was an issue merging, maybe try again yeonjuan. Details |
LGTM |
There was an issue merging, maybe try again bumkeyy. Details |
Co-authored-by: Seohee Park <dvlprsh103@gmail.com>
LGTM |
There was an issue merging, maybe try again bumkeyy. Details |
LGTM |
There was an issue merging, maybe try again bumkeyy. Details |
LGTM |
There was an issue merging, maybe try again bumkeyy. Details |
LGTM |
There was an issue merging, maybe try again bumkeyy. Details |
If you have time, please check this merge issue. #131 (comment) |
b6c3a6d
번역 확인 부탁드려요~