Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Project
- prj
- mysql
- webpack
- sql
- ๋น๋๊ธฐ
- ์ฐธ๊ณ ๋ธ๋ก๊ทธ
- setTimeout()
- database
- execCommand
- JS #ํ๋ก์ ํธ
- ํผํ
- ๊ฒ์
- object
- slow and steady
- Import
- promise
- addEventListener
- await
- Porject
- ajax
- ๋๊ธฐ
- https://m.blog.naver.com/tt2t2am1118/221010125300
- eport
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- json
- db
- async
- js
- callback
Archives
- Today
- Total
C-log
section29-ํ๋กํ ํ์ , ํด๋์ค, ๊ทธ๋ฆฌ๊ณ OOP(๋ฐฑ์๋๋ฅผ ๋ฃ๊ณ ๋์ค์ ๋ค์ ๋ค์ด๋ ๋ฌด๋ฐฉํ๋ค) ๋ณธ๋ฌธ
๐JS/โกver.0
section29-ํ๋กํ ํ์ , ํด๋์ค, ๊ทธ๋ฆฌ๊ณ OOP(๋ฐฑ์๋๋ฅผ ๋ฃ๊ณ ๋์ค์ ๋ค์ ๋ค์ด๋ ๋ฌด๋ฐฉํ๋ค)
4:Bee 2023. 4. 4. 22:49728x90
Topic | explain | class | |
Prototype | prototype/__proto__ | ํ๋กํ ํ์ ์ ์ฒญ์ฌ์ง๊ณผ ๊ฐ๋ค. ์๋ฅผ ๋ค์ด arr.includes(2)๋ฅผ ์ฌ์ฉํ ๋ includes()์ ํจ์๋ ํ๋กํ ํ์ ๊ฐ์ฒด์์ ์ ์๋๋ค. | ํ๋กํ ํ์ ์ด๋? |
String.prototype.yell = function () {
return `OMG!! ${this.toUpperCase()}!!!!`
}
Array.prototype.pop = function() {
return 'SORRY I WANT THAT ELEMENT, I WILL NEVER POP IT OFF!';
}
|
|||
์ฌ๊ธฐ์ prototpye์ ๋ฉ์๋๋ ํน์ฑ์ ์ถ๊ฐํ๋ ์ค์ ๊ฐ์ฒด์ด๋ค. ํ ํ๋ฆฟ ๊ฐ์ฒด, ์ฆ ํ๋กํ ํ์ ์ด๋ค. | |||
![]() ![]() |
|||
์ฌ๊ธฐ์ [[prototpye]]/(__proto__)์ ์ฐธ์กฐ์ด๋ค. [[prototpye]]/(__proto__)์ ์ด ๋ฐฐ์ด์ด๋ ๋ฌธ์์ด์ ํน์ฑ ์ด๋ฆ์ด๋ค. | |||
OOP์ ๊ฐ์ | - | ๊ฐ์ฒด ์งํฅ ํ๋ก๊ทธ๋๋ฐ ๊ฐ์ | |
ํฉํ ๋ฆฌํจ์ | ํฉํ ๋ฆฌ๋ผ๋ ์ฉ์ด๋ ์ด๋ค ๊ฐ์ ์ ๋ฌํ๋ฉด ์ด ํฉํ ๋ฆฌ๊ฐ ๊ฐ์ฒด๋ฅผ ๋ง๋ค์ด์ฃผ๊ณ ๋ง์ง๋ง์ ๋ฐํํ์ฌ ์ฐ๋ฆฌ๊ฐ ์ฌ์ฉํ ์ ์๊ฒ ๋๋ค๋ ๊ฒ์ด๋ค. | ||
์ดํด๊ฐ ์์๊ฐ๋ค. ๋ค์ ๋ค์ด๋ณด๊ณ ๋ค์ ๋ณด๊ธฐ |
function makeColor(r,g,b){
const color = {};
color.r = r;
color.g = g;
color.b = b;
return color;
}
|
||
![]() |
ํฉํ ๋ฆฌ ํจ์ | ||
- | ์์ฑ์ ํจ์ | ||
ํด๋์ค | JavaScriptํด๋์ค | ||
class Color {
constructor(r, g, b, name) {
this.r = r;
this.g = g;
this.b = b;
this.name = name;
// console.log("constructor");
// console.log(r, g, b);
}
greet() {
return `Hello From A Color!! ${this.name}`
}
}
const c1 = new Color(32, 56, 78, 'idk');
|
|||
728x90
'๐JS > โกver.0' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
section31-์ฐ๋ฆฌ์ ์ฒซ ๋ฒ์งธ ๋๊ตฌ : ๋ ธ๋(Node) (0) | 2023.04.06 |
---|---|
section30-ํฐ๋ฏธ๋ ์๋ฒฝ ์ ๋ฆฌ (0) | 2023.04.05 |
section28-AJAX์API (0) | 2023.04.03 |
section27-๋น๋๊ธฐ์ JavaScript (0) | 2023.03.30 |
section24~25-DOM์ด๋~DOM ์ด๋ฒคํธ (0) | 2023.03.24 |
Comments