mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
435 lines
13 KiB
Markdown
435 lines
13 KiB
Markdown
|
---
|
|||
|
language: javascript
|
|||
|
category: language
|
|||
|
contributors:
|
|||
|
- ["Adam Brenecki", "http://adam.brenecki.id.au"]
|
|||
|
translators:
|
|||
|
- ["wikibook", "http://wikibook.co.kr"]
|
|||
|
lang: ko-kr
|
|||
|
---
|
|||
|
|
|||
|
<EFBFBD>ڹٽ<EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ<EFBFBD><EFBFBD> <20>ݽ<EFBFBD><DDBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>귻<EFBFBD><EAB7BB> <20><><EFBFBD><EFBFBD>ũ(Brendan Eich)<29><> 1995<39> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20>ܼ<EFBFBD><DCBC><EFBFBD> <20><>ũ<EFBFBD><C5A9>Ʈ <20><><EFBFBD> <20><>ǥ<EFBFBD><C7A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>µ<EFBFBD>,
|
|||
|
<EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD>̼<EFBFBD><CCBC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ڹٸ<DAB9> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȣ<EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>п<EFBFBD> <20><> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD>忡<EFBFBD><E5BFA1>
|
|||
|
<EFBFBD>ڹٺ<EFBFBD><EFBFBD><EFBFBD> <20>ξ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>̰<EFBFBD> <20>ƽ<EFBFBD><C6BD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ѵ<EFBFBD><D1B5><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD> ũ<><C5A9><EFBFBD><EFBFBD> V8 <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> Node.js<6A><73> <20><><EFBFBD><EFBFBD> <20>α⸦ <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
<EFBFBD>ǵ<EFBFBD><EFBFBD><EFBFBD> <20>ֽø<D6BD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰڽ<CFB0><DABD>ϴ<EFBFBD>! [@adambrenecki](https://twitter.com/adambrenecki)<29><>
|
|||
|
[adam@brenecki.id.au](mailto:adam@brenecki.id.au)<29><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
```js
|
|||
|
// <20>ּ<EFBFBD><D6BC><EFBFBD> C<><43> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>. <20><> <20><>¥<EFBFBD><C2A5> <20>ּ<EFBFBD><D6BC><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD>,
|
|||
|
/* <20><><EFBFBD><EFBFBD> <20><> <20>ּ<EFBFBD><D6BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ǥ<EFBFBD><C7A5> <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>
|
|||
|
<20><>ǥ <20><><EFBFBD><EFBFBD><EFBFBD>÷<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>. */
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD>(;)<29><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
doStuff();
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD> <20><><EFBFBD>µ<EFBFBD>, Ư<><C6AF> <20><><EFBFBD>츦 <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD>
|
|||
|
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD> <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ԵDZ<D4B5> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
|||
|
doStuff()
|
|||
|
|
|||
|
// <20><><EFBFBD>⼭<EFBFBD><E2BCAD> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰڽ<CFB0><DABD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>δ<EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD>̵带 <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
///////////////////////////////////
|
|||
|
// 1. <20><><EFBFBD><EFBFBD>, <20><><EFBFBD>ڿ<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
// <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><> <20>ϳ<EFBFBD><CFB3><EFBFBD> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8>(64<36><34>Ʈ IEEE 754 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>
|
|||
|
// <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
3 // = 3
|
|||
|
1.5 // = 1.5
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
1 + 1 // = 2
|
|||
|
8 - 1 // = 7
|
|||
|
10 * 2 // = 20
|
|||
|
35 / 5 // = 7
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ե˴ϴ<CBB4>.
|
|||
|
5 / 2 // = 2.5
|
|||
|
|
|||
|
// <20><>Ʈ <20><><EFBFBD>굵 <20><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>. float<61><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD>
|
|||
|
// 32<33><32>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><>ȣ<EFBFBD><C8A3> <20>ִ<EFBFBD> int<6E><74> <20><>ȯ<EFBFBD>˴ϴ<CBB4>.
|
|||
|
1 << 2 // = 4
|
|||
|
|
|||
|
// <20><>ȣ<EFBFBD><C8A3> <20>̿<EFBFBD><CCBF>ϸ<EFBFBD> <20>켱<EFBFBD><ECBCB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
(1 + 3) * 2 // = 8
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ڰ<EFBFBD> <20>ƴ<EFBFBD> Ư<><C6AF><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
Infinity // 1/0 1/0<><30> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
-Infinity // -1/0<><30> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
NaN // 0/0<><30> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
// <20>Ҹ<EFBFBD> Ÿ<>Ե<EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
true
|
|||
|
false
|
|||
|
|
|||
|
// <20><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> '<27><> "<22><> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
'abc'
|
|||
|
"Hello, world"
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD>꿡<EFBFBD><EABFA1> ! <20><>ȣ<EFBFBD><C8A3> <20>̿<EFBFBD><CCBF>մϴ<D5B4>.
|
|||
|
!true // = false
|
|||
|
!false // = true
|
|||
|
|
|||
|
// <20><><EFBFBD>ϼ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ==
|
|||
|
1 == 1 // = true
|
|||
|
2 == 1 // = false
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD>ġ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> !=
|
|||
|
1 != 1 // = false
|
|||
|
2 != 1 // = true
|
|||
|
|
|||
|
// <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
1 < 10 // = true
|
|||
|
1 > 10 // = false
|
|||
|
2 <= 2 // = true
|
|||
|
2 >= 2 // = true
|
|||
|
|
|||
|
// <20><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> +<2B><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
"Hello " + "world!" // = "Hello world!"
|
|||
|
|
|||
|
// <20><EFBFBD><D7B8><EFBFBD> <<EFBFBD><EFBFBD> ><3E><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
"a" < "b" // = true
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȯ<EFBFBD><C8AF> <20><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>.
|
|||
|
"5" == 5 // = true
|
|||
|
|
|||
|
// ===<3D><> <20><><EFBFBD><EFBFBD> <20>ʴ´ٸ<C2B4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
"5" === 5 // = false
|
|||
|
|
|||
|
// charAt<41><74> <20>̿<EFBFBD><CCBF>ϸ<EFBFBD> <20><><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
"This is a string".charAt(0)
|
|||
|
|
|||
|
// null<6C><6C> undefined<65><64> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
null // <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ƴ<EFBFBD><C6B4><EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
undefined // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
|
|||
|
// null, undefinded, NaN, 0, ""<22><> <20><><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD>, <20><> <20><><EFBFBD><EFBFBD> <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>Դϴ<D4B4>.
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<><30> <20><><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD>, "0"<22><> <20><><EFBFBD>Դϴ<D4B4>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 == "0"<22>̴<EFBFBD><CCB4><EFBFBD><EFBFBD><EFBFBD>).
|
|||
|
|
|||
|
///////////////////////////////////
|
|||
|
// 2. <20><><EFBFBD><EFBFBD>, <20>迭, <20><>ü
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> var Ű<><C5B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>. <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// Ÿ<><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʿ䰡 <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD> <20>Ҵ<EFBFBD><D2B4><EFBFBD> <20><><EFBFBD><EFBFBD> = <20><><EFBFBD><EFBFBD> <20>ϳ<EFBFBD><CFB3><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
var someVar = 5
|
|||
|
|
|||
|
// var Ű<><C5B0><EFBFBD>带 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʾƵ<CABE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><DFBB><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
|||
|
someOtherVar = 10
|
|||
|
|
|||
|
// <20><EFBFBD><D7B7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƴ϶<C6B4>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>.
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20>Ҵ<EFBFBD><D2B4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> undefined<65><64> <20><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>.
|
|||
|
var someThirdVar // = undefined
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ǥ<><C7A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
|||
|
someVar += 5 // someVar = someVar + 5;<3B><> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> someVar<61><72> 10.
|
|||
|
someVar *= 10 // somVar<61><72> 100
|
|||
|
|
|||
|
// 1<><31> <20><><EFBFBD>ϰų<CFB0> <20><><EFBFBD><EFBFBD> <20>ξ<EFBFBD> <20><> ª<><C2AA> ǥ<><C7A5><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
someVar++ // <20><><EFBFBD><EFBFBD> someVar<61><72> 101
|
|||
|
someVar-- // <20>ٽ<EFBFBD> 100<30><30><EFBFBD><EFBFBD> <20>ǵ<EFBFBD><C7B5>ư<EFBFBD>
|
|||
|
|
|||
|
// <20>迭<EFBFBD><E8BFAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
|||
|
var myArray = ["Hello", 45, true]
|
|||
|
|
|||
|
// <20>迭<EFBFBD><E8BFAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3> <20>ѷ<EFBFBD><D1B7><EFBFBD> <20>ε<EFBFBD><CEB5><EFBFBD><EFBFBD><EFBFBD> <20>̿<EFBFBD><CCBF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
// <20>迭<EFBFBD><E8BFAD> <20>ε<EFBFBD><CEB5><EFBFBD><EFBFBD><EFBFBD> 0<><30><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
myArray[1] // = 45
|
|||
|
|
|||
|
// <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> <20><>ü<EFBFBD><C3BC> <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '<27><><EFBFBD><EFBFBD>'<27>̳<EFBFBD> '<27><>'<27><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
|||
|
// <20><>, Ű-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
|||
|
{key1: "Hello", key2: "World"}
|
|||
|
|
|||
|
// Ű<><C5B0> <20><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><C7A5> <20>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD> <20> Ÿ<><C5B8><EFBFBD>̵<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
var myObj = {myKey: "myValue", "my other key": 4}
|
|||
|
|
|||
|
// <20><>ü <20>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD> <20>ε<EFBFBD><CEB5><EFBFBD><EFBFBD><EFBFBD> <20>̿<EFBFBD><CCBF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
myObj["my other key"] // = 4
|
|||
|
|
|||
|
// <20>Ǵ<EFBFBD> Ű<><C5B0> <20><>ȿ<EFBFBD><C8BF> <20>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> ǥ<><C7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̿<EFBFBD><CCBF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
myObj.myKey // = "myValue"
|
|||
|
|
|||
|
// <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>. <20><>, <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰų<CFB0> <20><> Ű<><C5B0> <20>߰<EFBFBD><DFB0><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
myObj.myThirdKey = true
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD><CFB7><EFBFBD> <20>ϸ<EFBFBD> undefined<65><64> <20><>ȯ<EFBFBD>˴ϴ<CBB4>.
|
|||
|
myObj.myFourthKey // = undefined
|
|||
|
|
|||
|
///////////////////////////////////
|
|||
|
// 3. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
// if <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
var count = 1
|
|||
|
if (count == 3){
|
|||
|
// count<6E><74> 3<><33> <20><><EFBFBD><EFBFBD> <20><EFBFBD>
|
|||
|
} else if (count == 4) {
|
|||
|
// count<6E><74> 4<><34> <20><><EFBFBD><EFBFBD> <20><EFBFBD>
|
|||
|
} else {
|
|||
|
// count<6E><74> 3<>̳<EFBFBD> 4<><34> <20>ƴ<EFBFBD> <20><><EFBFBD>쿡 <20><EFBFBD>
|
|||
|
}
|
|||
|
|
|||
|
// while<6C><65> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
|||
|
while (true) {
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>!
|
|||
|
}
|
|||
|
|
|||
|
// do-while <20><><EFBFBD><EFBFBD> <20><EFBFBD> <20>ּ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ȴٴ<C8B4> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD>
|
|||
|
// while <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
var input
|
|||
|
do {
|
|||
|
input = getInput()
|
|||
|
} while (!isValid(input))
|
|||
|
|
|||
|
// for <20><><EFBFBD><EFBFBD> C<><43> <20>ڹ<EFBFBD><DAB9><EFBFBD> for <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
|||
|
// <20>ʱ<EFBFBD>ȭ<EFBFBD><C8AD>; <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
for (var i = 0; i < 5; i++){
|
|||
|
// 5<><35> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
|
|||
|
// &&<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> and<6E>̰<EFBFBD> ||<7C><> <20><><EFBFBD><EFBFBD> or<6F>Դϴ<D4B4>.
|
|||
|
if (house.size == "big" && house.colour == "blue"){
|
|||
|
house.contains = "bear"
|
|||
|
}
|
|||
|
if (colour == "red" || colour == "blue"){
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>̰ų<CCB0> <20>Ķ<EFBFBD>
|
|||
|
}
|
|||
|
|
|||
|
// &&<EFBFBD><EFBFBD> ||<7C><> "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"<22><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴµ<CFB4>, <20>⺻<EFBFBD><E2BABB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
var name = otherName || "default"
|
|||
|
|
|||
|
///////////////////////////////////
|
|||
|
// 4. <20>Լ<EFBFBD>, <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD>, Ŭ<><C5AC><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
// <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20>Լ<EFBFBD><D4BC><EFBFBD> function Ű<><C5B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
function myFunction(thing){
|
|||
|
return thing.toUpperCase()
|
|||
|
}
|
|||
|
myFunction("foo") // = "FOO"
|
|||
|
|
|||
|
// <20>Լ<EFBFBD><D4BC><EFBFBD> "<22><EFBFBD>"<22><><EFBFBD><EFBFBD>, <20><> <20≯<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
function(thing){
|
|||
|
return thing.toLowerCase()
|
|||
|
}
|
|||
|
// (<28>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD><EFBFBD>Ű<EFBFBD><C5B0> <20≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> ȣ<><C8A3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>)
|
|||
|
|
|||
|
// <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20>Լ<EFBFBD><D4BC><EFBFBD> <20>ϱ<EFBFBD> <20><>ü<EFBFBD>̹Ƿ<CCB9> <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ҵ<EFBFBD><D2B4>ϰ<EFBFBD>
|
|||
|
// <20>ٸ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD>ڷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD>, <20>̺<EFBFBD>Ʈ <20>ڵ鷯<DAB5><E9B7AF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
function myFunction(){
|
|||
|
// <20><> <20>ڵ<EFBFBD><DAB5><EFBFBD> 5<><35> <20><><EFBFBD><EFBFBD> ȣ<><C8A3><EFBFBD><EFBFBD>
|
|||
|
}
|
|||
|
setTimeout(myFunction, 5000)
|
|||
|
|
|||
|
// <20>ٸ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> ȣ<><C8A3><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ۼ<EFBFBD><DBBC><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
setTimeout(function myFunction(){
|
|||
|
// <20><> <20>ڵ<EFBFBD><DAB5><EFBFBD> 5<><35> <20><><EFBFBD><EFBFBD> ȣ<><C8A3><EFBFBD><EFBFBD>
|
|||
|
}, 5000)
|
|||
|
|
|||
|
// <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20>Լ<EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
// <20>Լ<EFBFBD><D4BC><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
|||
|
if (true){
|
|||
|
var i = 5
|
|||
|
}
|
|||
|
i // = 5 - <20><><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EEBFA1><EFBFBD><EFBFBD> undefined<65><64> <20>ƴմϴ<D5B4>.
|
|||
|
|
|||
|
// <20>̰<EFBFBD><CCB0><EFBFBD> "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD> <20><EFBFBD> <20>Լ<EFBFBD>"<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̾<EFBFBD><CCBE><EFBFBD><EFBFBD>µ<EFBFBD>,
|
|||
|
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ӽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ǵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
|||
|
(function(){
|
|||
|
var temporary = 5
|
|||
|
// '<27><><EFBFBD><EFBFBD> <20><>ü'<27><> <20>Ҵ<EFBFBD><D2B4>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ִµ<D6B4>,
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC> <20><EFBFBD> 'window'<27>Դϴ<D4B4>. <20><><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC>
|
|||
|
// Node.js<6A><73> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƴ<EFBFBD> ȯ<>濡<EFBFBD><E6BFA1><EFBFBD><EFBFBD> <20>ٸ<EFBFBD> <20≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
window.permanent = 10
|
|||
|
// <20>Ǵ<EFBFBD> <20>տ<EFBFBD><D5BF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ߴٽ<DFB4><D9BD><EFBFBD> var Ű<><C5B0><EFBFBD>带 <20><> <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
permanent2 = 15
|
|||
|
})()
|
|||
|
temporary // ReferenceError <20><EFBFBD>
|
|||
|
permanent // = 10
|
|||
|
permanent2 // = 15
|
|||
|
|
|||
|
// <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20>ϳ<EFBFBD><CFB3><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD>(closure)<29>Դϴ<D4B4>.
|
|||
|
// <20>Լ<EFBFBD><D4BC><EFBFBD> <20>ٸ<EFBFBD> <20>Լ<EFBFBD> <20>ȿ<EFBFBD><C8BF><EFBFBD> <20><><EFBFBD>ǵǸ<C7B5> <20><><EFBFBD>ʿ<EFBFBD> <20><><EFBFBD>ǵ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20>ٱ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
function sayHelloInFiveSeconds(name){
|
|||
|
var prompt = "Hello, " + name + "!"
|
|||
|
function inner(){
|
|||
|
alert(prompt)
|
|||
|
}
|
|||
|
setTimeout(inner, 5000)
|
|||
|
// setTimeout<75><74> <20><EFBFBD><F1B5BFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϹǷ<CFB9> <20><> <20>Լ<EFBFBD><D4BC><EFBFBD> 5<><35> <20><><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD>ٸ<EFBFBD><D9B8><EFBFBD> <20>ʰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ĩ<EFBFBD>ϴ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 5<>ʰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> inner<65><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// prompt<70><74> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
}
|
|||
|
sayHelloInFiveSeconds("Adam") // will open a popup with "Hello, Adam!" in 5s
|
|||
|
|
|||
|
///////////////////////////////////
|
|||
|
// 5. <20><>ü <20><>ȭ; <20><><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8>
|
|||
|
|
|||
|
// <20><>ü<EFBFBD><C3BC> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
var myObj = {
|
|||
|
myFunc: function(){
|
|||
|
return "Hello world!"
|
|||
|
}
|
|||
|
}
|
|||
|
myObj.myFunc() // = "Hello world!"
|
|||
|
|
|||
|
// <20><>ü<EFBFBD><C3BC> <20><><EFBFBD>Ե<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> ȣ<><C8A3><EFBFBD>Ǹ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> this Ű<><C5B0><EFBFBD>带 <20>̿<EFBFBD><CCBF><EFBFBD>
|
|||
|
// <20>ش<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD>Ե<EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
myObj = {
|
|||
|
myString: "Hello world!",
|
|||
|
myFunc: function(){
|
|||
|
return this.myString
|
|||
|
}
|
|||
|
}
|
|||
|
myObj.myFunc() // = "Hello world!"
|
|||
|
|
|||
|
// <20><><EFBFBD>⼭ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD>ǵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ƴ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> ȣ<><C8A3><EFBFBD>Ǵ<EFBFBD>
|
|||
|
// <20><><EFBFBD>İ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. <20><EFBFBD><D7B7><EFBFBD> <20>Ʒ<EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><>ü <20><><EFBFBD>ؽ<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD>
|
|||
|
// ȣ<><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
|||
|
var myFunc = myObj.myFunc
|
|||
|
myFunc() // = undefined
|
|||
|
|
|||
|
// <20>ݴ<EFBFBD><DDB4><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><>ü<EFBFBD><C3BC> <20>Ҵ<EFBFBD><D2B4>ϰ<EFBFBD> this<69><73> <20><><EFBFBD><EFBFBD> <20>ش<EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
// <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ü<EFBFBD><C3BC> <20>߰<EFBFBD><DFB0><EFBFBD><EFBFBD><EFBFBD> <20>ʾҴ<CABE><D2B4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.
|
|||
|
var myOtherFunc = function(){
|
|||
|
return this.myString.toUpperCase()
|
|||
|
}
|
|||
|
myObj.myOtherFunc = myOtherFunc
|
|||
|
myObj.myOtherFunc() // = "HELLO WORLD!"
|
|||
|
|
|||
|
// new Ű<><C5B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> ȣ<><C8A3><EFBFBD>ϸ<EFBFBD> <20><><EFBFBD>ο<EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD> this<69><73> <20><><EFBFBD><EFBFBD>
|
|||
|
// <20>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ְ<EFBFBD> <20>˴ϴ<CBB4>. <20>̷<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ڶ<EFBFBD> <20>մϴ<D5B4>.
|
|||
|
|
|||
|
var MyConstructor = function(){
|
|||
|
this.myNumber = 5
|
|||
|
}
|
|||
|
myNewObj = new MyConstructor() // = {myNumber: 5}
|
|||
|
myNewObj.myNumber // = 5
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20><>ü<EFBFBD><C3BC> 'prototype'<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. <20> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD> <20><><EFBFBD>η<EFBFBD>Ÿ<EFBFBD>Կ<EFBFBD><D4BF><EFBFBD>
|
|||
|
// <20>ش<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC> ã<><C3A3><EFBFBD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
// <20>Ϻ<EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20><><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> __proto__<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC>
|
|||
|
// <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD>Կ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ <20>մϴ<D5B4>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<CFB1><E2BFA1> <20>̷<EFBFBD> <20><><EFBFBD>뵵 <20><><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD> __proto__<EFBFBD><EFBFBD> ǥ<>ؿ<EFBFBD> <20><><EFBFBD>Ե<EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>. <20><><EFBFBD>߿<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> ǥ<><C7A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>캸<EFBFBD>ڽ<EFBFBD><DABD>ϴ<EFBFBD>.
|
|||
|
var myObj = {
|
|||
|
myString: "Hello world!",
|
|||
|
}
|
|||
|
var myPrototype = {
|
|||
|
meaningOfLife: 42,
|
|||
|
myFunc: function(){
|
|||
|
return this.myString.toLowerCase()
|
|||
|
}
|
|||
|
}
|
|||
|
myObj.__proto__ = myPrototype
|
|||
|
myObj.meaningOfLife // = 42
|
|||
|
|
|||
|
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>մϴ<D5B4>.
|
|||
|
myObj.myFunc() // = "hello world!"
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD>Կ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> ã<><C3A3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>.
|
|||
|
myPrototype.__proto__ = {
|
|||
|
myBoolean: true
|
|||
|
}
|
|||
|
myObj.myBoolean // = true
|
|||
|
|
|||
|
// <20><><EFBFBD>⼭ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ͼ<CFBE><EEB3AA> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>. <20><> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD>Կ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. <20>̴<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ݿ<EFBFBD><DDBF>ȴٴ<C8B4> <20>ǹ<EFBFBD><C7B9>Դϴ<D4B4>.
|
|||
|
myPrototype.meaningOfLife = 43
|
|||
|
myObj.meaningOfLife // = 43
|
|||
|
|
|||
|
// <20>տ<EFBFBD><D5BF><EFBFBD> __proto__<EFBFBD><EFBFBD> ǥ<>ؿ<EFBFBD> <20><><EFBFBD>Ե<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʴٰ<CAB4> <20>̾߱<CCBE><DFB1>ߴµ<DFB4>,
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> ǥ<><C7A5> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>.
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ư<><C6AF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ο<EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
// ù <20><>° <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Object.create<74><65> <20>̿<EFBFBD><CCBF>ϴ<EFBFBD> <20><><EFBFBD>ε<EFBFBD>,
|
|||
|
// Object.create<74><65> <20>ֱٿ<D6B1> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> <20>߰<EFBFBD><DFB0><EFBFBD> <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD> <20>̿<EFBFBD><CCBF><EFBFBD> <20><> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ƴմϴ<D5B4>.
|
|||
|
var myObj = Object.create(myPrototype)
|
|||
|
myObj.meaningOfLife // = 43
|
|||
|
|
|||
|
// <20><> <20><>° <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> prototype<70>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Լ<EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> *<2A>ƴϰ<C6B4>* <20><><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD> new Ű<><C5B0><EFBFBD>带 <20>̿<EFBFBD><CCBF><EFBFBD>
|
|||
|
// <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>ο<EFBFBD> <20><>ü<EFBFBD><C3BC> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD>Դϴ<D4B4>.
|
|||
|
myConstructor.prototype = {
|
|||
|
getMyNumber: function(){
|
|||
|
return this.myNumber
|
|||
|
}
|
|||
|
}
|
|||
|
var myNewObj2 = new myConstructor()
|
|||
|
myNewObj2.getMyNumber() // = 5
|
|||
|
|
|||
|
// <20><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> <20><><EFBFBD>ڿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ÿ<>Կ<EFBFBD><D4BF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ڰ<EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
var myNumber = 12
|
|||
|
var myNumberObj = new Number(12)
|
|||
|
myNumber == myNumberObj // = true
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ȯ<EFBFBD><C8AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
|||
|
typeof(myNumber) // = 'number'
|
|||
|
typeof(myNumberObj) // = 'object'
|
|||
|
myNumber === myNumberObj // = false
|
|||
|
if (0){
|
|||
|
// 0<><30> <20><><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><> <20>ڵ<EFBFBD><DAB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
|||
|
}
|
|||
|
if (Number(0)){
|
|||
|
// Number(0)<29><> <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><> <20>ڵ<EFBFBD><DAB5><EFBFBD> *<2A><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>*.
|
|||
|
}
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC> <20>Ϲ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>߰<EFBFBD><DFB0><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
String.prototype.firstCharacter = function(){
|
|||
|
return this.charAt(0)
|
|||
|
}
|
|||
|
"abc".firstCharacter() // = "a"
|
|||
|
|
|||
|
// <20>̷<EFBFBD><CCB7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE>
|
|||
|
// <20><><EFBFBD>ο<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(polyfilling)"<22><> <20><><EFBFBD><EFBFBD> <20>̿<EFBFBD><CCBF>ǹǷ<C7B9>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ȯ<>濡<EFBFBD><E6BFA1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, Object.create<74><65> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ƴ϶<C6B4><CFB6><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ʒ<EFBFBD><C6B7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̿<EFBFBD><CCBF><EFBFBD> Object.create<74><65> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
if (Object.create === undefined){ // don't overwrite it if it exists
|
|||
|
Object.create = function(proto){
|
|||
|
// <20>ùٸ<C3B9> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ӽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
var Constructor = function(){}
|
|||
|
Constructor.prototype = proto
|
|||
|
// <20><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ӽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ڸ<EFBFBD> <20>̿<EFBFBD><CCBF><EFBFBD> <20><><EFBFBD>ο<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD>
|
|||
|
return new Constructor()
|
|||
|
}
|
|||
|
}
|
|||
|
```
|
|||
|
|
|||
|
## <20><>Ÿ <20><><EFBFBD><EFBFBD> <20>ڷ<EFBFBD>
|
|||
|
|
|||
|
[<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ʈ<EFBFBD><C6AE>ũ](https://developer.mozilla.org/en-US/docs/Web/JavaScript)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<EFBFBD>ڹٽ<EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD><C7B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>. <20><><EFBFBD>Ҿ<EFBFBD> <20><>Ű <20><><EFBFBD><EFBFBD><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ǹ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>и<EFBFBD><D0B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD> <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>鿡<EFBFBD><E9BFA1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>.
|
|||
|
|
|||
|
MDN<EFBFBD><EFBFBD> ['<27>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20><><EFBFBD>Թ<EFBFBD>'](https://developer.mozilla.org/ko/docs/A_re-introduction_to_JavaScript)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD>⼭ <20>ٷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ڼ<EFBFBD><DABC><EFBFBD> <20>ٷ<EFBFBD><D9B7><EFBFBD> <20>ֽ<EFBFBD><D6BD>ϴ<EFBFBD>. <20><> <20>ڷῡ<DAB7><E1BFA1><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20><><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <20>ٷ<EFBFBD><D9B7><EFBFBD><EFBFBD>ϴ<EFBFBD>. <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʹٸ<CDB4>
|
|||
|
[<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ü <20><><EFBFBD><EFBFBD>(Document Object Model)](https://developer.mozilla.org/en-US/docs/Using_the_W3C_DOM_Level_1_Core)<29><>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20>ٶ<EFBFBD><D9B6>ϴ<EFBFBD>.
|
|||
|
|
|||
|
[<EFBFBD>ڹٽ<EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>](http://bonsaiden.github.io/JavaScript-Garden/)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ڹٽ<DAB9>ũ<EFBFBD><C5A9>Ʈ <20><><EFBFBD><EFBFBD><EEBFA1>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>߳<EFBFBD><DFB3><EFBFBD> <20><><EFBFBD><EFBFBD> <20>κе<CEBA><D0B5><EFBFBD> <20>ɵ<EFBFBD> <20>ְ<EFBFBD> <20>ٷ<EFBFBD><D9B7>ϴ<EFBFBD>.
|
|||
|
|
|||
|
<EFBFBD><EFBFBD><EFBFBD>Ҿ<EFBFBD> <20><> <20>ۿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E2BFA9> <20>е<EFBFBD><D0B5><EFBFBD>, <20><><EFBFBD><EFBFBD> <20><> <20>Ϻδ<CFBA> <20><> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ִ<EFBFBD>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>(Louie Dihn)<29><> <20><><EFBFBD>̽<EFBFBD> Ʃ<>丮<EFBFBD><E4B8AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ʈ<EFBFBD><C6AE>ũ<EFBFBD><C5A9> <20>ִ<EFBFBD>
|
|||
|
[<EFBFBD>ڹٽ<EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ Ʃ<>丮<EFBFBD><E4B8AE>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript)<29><> <20><><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD>ϴ<EFBFBD>.
|