-
Notifications
You must be signed in to change notification settings - Fork 130
Translate 1 file to ko - Classes 101 #30
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
github-actions
merged 7 commits into
microsoft:main
from
yahma25:Translation-to-ko-playground-Classes-101
Feb 14, 2021
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d17078b
Translate 1 file to ko - Classes 101
yahma25 26374be
Update docs/playground/ko/JavaScript/Working With Classes/Classes 101.ts
yahma25 152187b
Update docs/playground/ko/JavaScript/Working With Classes/Classes 101.ts
yahma25 2d66ceb
Update docs/playground/ko/JavaScript/Working With Classes/Classes 101.ts
yahma25 6649f65
Update docs/playground/ko/JavaScript/Working With Classes/Classes 101.ts
yahma25 49aec7a
Update docs/playground/ko/JavaScript/Working With Classes/Classes 101.ts
yahma25 7dc6a92
Fix to remove the space
yahma25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
docs/playground/ko/JavaScript/Working With Classes/Classes 101.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
//// { order: 0 } | ||
|
||
// 클래스는 생성자를 이용해서 생성하는 | ||
// JavaScript 오브젝트의 특별한 타입입니다. | ||
// 클래스는 오브젝트와 아주 흡사하게 동작하며 | ||
// Java/C#/Swift 같은 언어와 비슷한 상속 구조를 가집니다. | ||
|
||
// 클래스 예시: | ||
|
||
class Vendor { | ||
name: string; | ||
|
||
constructor(name: string) { | ||
this.name = name; | ||
} | ||
|
||
greet() { | ||
return "Hello, welcome to " + this.name; | ||
} | ||
} | ||
|
||
// 인스턴스는 new 키워드를 이용해서 생성할 수 있으며 | ||
// 메서드를 호출하고 | ||
// 오브젝트의 프로퍼티에 접근할 수 있습니다. | ||
|
||
const shop = new Vendor("Ye Olde Shop"); | ||
console.log(shop.greet()); | ||
|
||
// 오브젝트를 하위 클래스로 만들 수 있습니다. | ||
// 이름뿐만 아니라 다양한 음식을 가진 카트: | ||
|
||
class FoodTruck extends Vendor { | ||
cuisine: string; | ||
|
||
constructor(name: string, cuisine: string) { | ||
super(name); | ||
this.cuisine = cuisine; | ||
} | ||
|
||
greet() { | ||
return "Hi, welcome to food truck " + this.name + ". We serve " + this.cuisine + " food."; | ||
} | ||
} | ||
|
||
// 우리는 새로운 FoodTruck을 생성하기 위하여 | ||
yahma25 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// 매개변수 2개가 필요하다고 나타냈기 때문에 | ||
yahma25 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// TypeScript는 매개변수를 오직 하나만 사용할 경우, 에러를 표시: | ||
yahma25 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const nameOnlyTruck = new FoodTruck("Salome's Adobo"); | ||
|
||
// 매개변수 2개를 정확하게 전달하면 | ||
// FoodTruck의 새로운 인스턴스를 생성할 수 있음: | ||
yahma25 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const truck = new FoodTruck("Dave's Doritos", "junk"); | ||
console.log(truck.greet()); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.