Skip to content
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

convert web/javascript/reference html to md - (1) #7510

Merged
merged 2 commits into from
Aug 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions files/ko/web/javascript/reference/about/index.html

This file was deleted.

43 changes: 43 additions & 0 deletions files/ko/web/javascript/reference/about/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: 소개
slug: Web/JavaScript/Reference/About
translation_of: Web/JavaScript/Reference/About
---
{{JsSidebar}}
The JavaScript reference serves as a repository of facts about the JavaScript language. The entire language is described here in detail. As you write JavaScript code, you'll refer to these pages often (thus the title "JavaScript reference"). If you're learning JavaScript, or need help understanding some of its capabilities or features, check out the [JavaScript guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide).

The JavaScript language is intended to be used within some larger environment, be it a browser, server-side scripts, or similar. For the most part, this reference attempts to be environment-agnostic and does not target a web browser environment.

## Where to find JavaScript information

JavaScript documentation of core language features (pure [ECMAScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Language_Resources), for the most part) includes the following:

- The [JavaScript guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide)
- The [JavaScript reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference)

If you are new to JavaScript, start with the [guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide). Once you have a firm grasp of the fundamentals, you can use the [reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference) to get more details on individual objects and language constructs.

## Structure of the reference

In the JavaScript reference you can find the following chapters:

- [Standard built-in objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects)
- : This chapter documents all the JavaScript standard built-in objects, along with their methods and properties.
- [Statements and declarations](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements)
- : JavaScript applications consist of statements with an appropriate syntax. A single statement may span multiple lines. Multiple statements may occur on a single line if each statement is separated by a semicolon. This isn't a keyword, but a group of keywords.
- [Expressions and operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators)
- : This chapter documents all the JavaScript language operators, expressions and keywords.
- [Functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions)
- : Chapter about JavaScript functions.
- [Classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)
- : Chapter about JavaScript classes introduced in ECMAScript 2015.
- [Errors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors)
- : Chapter about specific errors, exceptions and warnings thrown by JavaScript.
- [New in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript)
- : Chapter about JavaScript version history.

### More reference pages

- [Deprecated and obsolete features](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features)
- [Lexical grammar](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar)
- [Data types and data structures](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures)
90 changes: 0 additions & 90 deletions files/ko/web/javascript/reference/classes/extends/index.html

This file was deleted.

96 changes: 96 additions & 0 deletions files/ko/web/javascript/reference/classes/extends/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
title: extends
slug: Web/JavaScript/Reference/Classes/extends
tags:
- Classes
- ECMAScript6
- JavaScript
translation_of: Web/JavaScript/Reference/Classes/extends
---
{{jsSidebar("Classes")}}

**`extends`** 키워드는 클래스를 다른 클래스의 자식으로 만들기 위해 [class 선언](/ko/docs/Web/JavaScript/Reference/Statements/class) 또는 [class 식](/ko/docs/Web/JavaScript/Reference/Operators/class)에 사용됩니다.

{{EmbedInteractiveExample("pages/js/classes-extends.html", "taller")}}

## 구문

```
class ChildClass extends ParentClass { ... }
```

## 설명

`extends` 키워드는 내장 객체뿐만 아니라 사용자 정의 클래스를 하위 클래스로 만들기 위해 사용될 수 있습니다.

확장( 클래스)의 `.prototype`은 {{jsxref("Object")}} 또는 {{jsxref("null")}}이어야 합니다.

## 예

### `extends` 사용하기

첫 번째 예는 `Polygon` 클래스로부터 `Square` 클래스를 만듭니다. 이 예는 [live demo](https://googlechrome.github.io/samples/classes-es6/index.html) [(source)](https://github.com/GoogleChrome/samples/blob/gh-pages/classes-es6/index.html)에서 발췌했습니다.

```js
class Square extends Polygon {
constructor(length) {
// 여기서, length와 함께 부모 클래스의 생성자를 호출
// Polygon의 너비 및 높이가 제공됨
super(length, length);
// 주의: 파생 클래스에서, super()가 먼저 호출되어야 'this'를
// 사용할 수 있습니다. 이를 빼먹으면 참조 오류가 발생합니다.
this.name = 'Square';
}

get area() {
return this.height * this.width;
}

set area(value) {
this.area = value;
}
}
```

### 내장 객체에 `extends` 사용하기

이 예제는 내장 객체 {{jsxref("Date")}}를 확장합니다. 이 예제는 [live demo](https://googlechrome.github.io/samples/classes-es6/index.html) [(source)](https://github.com/GoogleChrome/samples/blob/gh-pages/classes-es6/index.html)에서 발췌했습니다.

```js
class myDate extends Date {
constructor() {
super();
}

getFormattedDate() {
var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
return this.getDate() + "-" + months[this.getMonth()] + "-" + this.getFullYear();
}
}
```

### `null` 확장

{{jsxref("null")}}에서 확장은 prototype 객체가 {{jsxref("Object.prototype")}}으로부터 상속받지 않은 것을 제외하면 보통 클래스처럼 동작합니다.

```js
class nullExtends extends null {
constructor() {}
}

Object.getPrototypeOf(nullExtends); // Function.prototype
Object.getPrototypeOf(nullExtends.prototype) // null
```

## 명세서

{{Specifications}}

## 브라우저 호환성

{{Compat}}

## 참조

- [Classes](/ko/docs/Web/JavaScript/Reference/Classes)
- [super](/ko/docs/Web/JavaScript/Reference/Operators/super)
Loading