๊ฐ์ฒด์งํฅ์ธ์ด๋ฅผ ๋ฐฐ์ธ ๋ ํญ์ ๋์ค๋ ํค์๋ ์ค ํ๋๊ฐ class ์ ๋๋ค. ์ ๋ Java์ C++์ ๋ฐฐ์ธ ๋ ์ ํ๊ฒ ๋์๋๋ฐ ES6์์ class์ ์ฌ์ฉ์ด ๊ฐ๋ฅํด์ก์ต๋๋ค. ํ์ง๋ง ์ฌ๊ธฐ์ ์ง๊ณ ๋์ด๊ฐ์ผํ ๊ฒ์ด ์์ต๋๋ค. ํ๋กํ ํ์ ์ ๊ดํ ๊ฐ๋ ์ธ๋ฐ์ MDN์ Class์ ๊ดํ ๊ธ์ ์ด๋ฐ ๋ง์ด ๋์ต๋๋ค. JavaScript class๋ ECMAScript 6์ ํตํด ์๊ฐ๋์์ผ๋ฉฐ, ๊ธฐ์กด prototype ๊ธฐ๋ฐ์ ์์ ๋ณด๋ค ๋ช ๋ฃํ๊ฒ ์ฌ์ฉํ ์ ์์ต๋๋ค. Class ๋ฌธ๋ฒ์ ์๋ก์ด ๊ฐ์ฒด์งํฅ ์์ ๋ชจ๋ธ์ ์ ๊ณตํ๋ ๊ฒ์ ์๋๋๋ค. JavaScript class๋ ๊ฐ์ฒด๋ฅผ ์์ฑํ๊ณ ์์์ ๋ค๋ฃจ๋๋ฐ ์์ด ํจ์ฌ ๋ ๋จ์ํ๊ณ ๋ช ํํ ๋ฌธ๋ฒ์ ์ ๊ณตํฉ๋๋ค. javascript ๋ ํํ ๋กํ์ ๊ธฐ๋ฐ์ ์ธ์ด์ด๋ค. es6์์ ์ง์ํ๋ clas..
ํ์ดํ ํจ์์ ํน์ง ์ค ๋ง์ง๋ง์ ๋๋ค. ์ด์ ํฌ์คํ ์์๋ this๊ฐ ์กด์ฌํ์ง ์๋๋ค๋ ์ฃผ์ ์๋๋ฐ ๋ง์ง๋ง์ผ๋ก๋ arguments๊ฐ ์กด์ฌํ์ง ์๋๋ค๋ ์ฃผ์ ์ ๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก javascript ์์๋ arguments ๋ผ๋ ํค์๋๊ฐ ์กด์ฌํ๋๋ฐ์ ๊ฐ๋จํ ์ ์๋ก๋ arguments ๊ฐ์ฒด๋ ํจ์์ ์ ๋ฌ๋ ์ธ์์ ํด๋นํ๋ Array ํํ์ ๊ฐ์ฒด์ ๋๋ค.1234567891011function func1() { console.log(arguments[0]); // expected output: 1 console.log(arguments[1]); // expected output: 2 console.log(arguments[2]); // expected output: 3}func1(1, 2, 3);cs(์ถ์ฒ : https:..
์ด์ ์๋ ํ์ดํ ํจ์์ ๊ธฐ๋ณธ์ ์ธ ์ ์ธ๋ฐฉ๋ฒ์ ๋ํด ์์๋ณด์์ต๋๋ค. ์ด๋ฒ์ ํ์ดํ ํจ์์ ๋ํ๋์ ํน์ง์ธ this์ ๋ํด์ ์์๋ณด๊ฒ ์ต๋๋ค. ๊ธฐ๋ณธ์ ์ผ๋ก this๋ผ ํ๋ฉด ๋ค๋ฅธ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด๋ฅผ ํ๋ ๊ฒฝํ์ด ์๋ค๋ฉด ๊ต์ฅํ ๋ง์ด ๋ค์ด๋ดค์ ํค์๋์ ๋๋ค. public class Book { private String title; private String author; private int price; private String publisher; public Book(String title, String author, int price, String publisher) { this.title = title; this.author = author; this.price = price; this.publisher = pu..
์ฒซ ๋ฒ์งธ๋ก ํ์ดํ ํจ์์ ๋ํด์ ์์๋ณด๊ณ ์ ํฉ๋๋ค. ์ ๊ฐ ES6 ๋ฌธ๋ฒ์ ์ ํ์ ๋ ๊ฐ์ฅ ๋จผ์ ๋ณธ ๋ ์ ์ค์ ํ๋ ์ ๋๋ค. ๊ธฐ์กด์ ์๋ฐ์คํฌ๋ฆฝํธ์์๋ ๊ทธ๋ฌ๊ณ , c์ธ์ด๋ ์๋ฐ์์๋ ํจ์๋ผ๋์ง ๋ฐ๋ณต๋ฌธ๊ฐ์ ํ๋์ ๋ฉ์ด๋ฆฌ์ ํ๋ก์ธ์ค๋ ๋ ์ค๊ดํธ๋ก ๋ฌถ๋ ๋ฐฉ๋ฒ์ด์์ต๋๋ค. ๊ทธ๋ฐ๋ฐ ES6์์ ํ์ดํ ํจ์๋ผ๋ ๊ฒ์ด ๋ฑ์ฅํ๊ฒ ๋์์ต๋๋ค. โ์ด๋ป๊ฒ ์๊ฒจ๋จน์๋๊ฐ??๊ธฐ์กด์ ํจ์์์ฑ๋ฐฉ์๊ณผ ๋น๊ตํด์ ์์๋ณด๊ฒ ์ต๋๋ค. ์น ์์์ ํฌ๋กฌ ๊ฐ๋ฐ์๋๊ตฌ๋ฅผ ์ด์ฉํด์ ํ ์คํธ๋ฅผ ์งํํ๊ฒ ์ต๋๋ค. html ํผ์ ํ๋ ๋ง๋ค์ด์ ์๋ฐ์คํฌ๋ฆฝํธ ํ์ผ์ ํธ์ถํด์ ์์ฑํ์ ๋ ๋๊ณ ๊ทธ๋ฅ ํฌ๋กฌ ํ์ด์ง์์ ์ง์ ์์ฑํด๋ ์๊ด ์์ต๋๋ค. arrow.html123456789101112 Arrow cs ์ด๋ฐ ์์ผ๋ก arrow.js ํ์ผ์ ํธ์ถํ๋ ์๋ฌด ๊ฒ๋ ์๋ html ํผ์..
(์ด ๊ธ์ http://itstory.tk/entry/JavaScript-ES6-๋ฌธ๋ฒ-์ ๋ฆฌ [๋'s IT Story] ๋ฅผ ์ฐธ์กฐํ์์ต๋๋ค.)- ECMA๋ ? ECMAScript 2015๋ก๋ ์๋ ค์ ธ ์๋ ECMAScript 6๋ ECMAScript ํ์ค์ ๊ฐ์ฅ ์ต์ ๋ฒ์ ์ ๋๋ค. ES6๋ ์๋ก์ด ์ธ์ด ๊ธฐ๋ฅ์ด ํฌํจ๋ ์ฃผ์ ์ ๋ฐ์ดํธ์ด๋ฉฐ, 2009๋ ๋์ ํ์คํ๋ ES5 ์ดํ๋ก ์ธ์ด ๊ธฐ๋ฅ์ ๋ํ ์ฒซ ์ ๋ฐ์ดํธ์ด๊ธฐ๋ ํฉ๋๋ค. ํ์ฌ ์ฃผ์ JavaScript ์์ง๋ค์์ ES6 ๊ธฐ๋ฅ๋ค์ ๊ตฌํ ์ค์ ์์ต๋๋ค. (์ถ์ฒ : https://www.sencha.com/blog/ext-js-ecmascript-2015/) ES3๋ ์ฐ๋ฆฌ๊ฐ ์ผ๋ฐ์ ์ผ๋ก ์ฌ์ฉํ๋ ์๋ฐ์คํฌ๋ฆฝํธ ์ด๋ฉฐ, ES5์ ๊ธฐ๋ฅ๋ค๋ ๋ง์ด ์ฌ์ฉ ๋์ด์ง๊ณ ์์ต๋๋ค.ES6์ ๋ฌธ๋ฒ..
๋ง์ ๋์์ธ ํจํด๋ค์ด ์์ง๋ง ๊ทธ์ค์ ๊ต์ฅํ ์์ฃผ ์ฐ์ด๊ณ ์ฐ๋ฉด ํธ๋ฆฌํ Singletonํจํด์ ๋ํด ๊ณต๋ถํด๋ณด๊ฒ ์ต๋๋ค.์ฑ๊ธํคํจํด์ ๋ณดํต ํน์ ๊ฐ์ฒด์ ์ ๋ณด๋ฅผ ์ฌ๋ฌ๊ตฐ๋ฐ์์ ์ฌ์ฉํ ์ผ์ด ๋ง์ ๋ ๊ทธ ๊ฐ์ฒด(์ธ์คํด์ค)๋ฅผ ์ฝ๊ฒ ์ฌ์ฉ๊ฐ๋ฅํ ๋์์ธ ํจํด์ ๋๋ค.์๋ฅผ๋ค๋ฉด ์ฌ์ฉ์์ ๋ก๊ทธ์ธ์ ๋ณด๋ฅผ ๊ณ์ํด์ ์ฌ์ฉํด์ผํ ๋ ์ด๋ฌํ ํจํด์ด ๋์์ด ๋ ์ ์์ต๋๋ค. ์ ๊ฐ ์ฌ์ฉํ ์์์ฝ๋์ ๋๋ค. 12345678910111213141516171819202122232425var SingletonClass = (function() { var mName,mNick,mId,mPwd,mIsLogin,instance; function SingletonClass() { } //setter this.__defineSetter__("mName",functio..
์ฑ๋ดํ์์ ์ด์คํ๊ฒ ๋ฐ๋ผํ ๊ฒ์ธ๋ฐ ๋ณดํต ์ฑํ ํ ๋ ๋ฒํผ์ด ์์ด๋ ์ํฐํค๋ฅผ ๋๋ฌ์ ์ ์ก์ํค๋ ๋์์ด ์ผ๋ฐ์ ์ด๋ค.๋ฌผ๋ก ์ค๋ฐ๊ฟ์ด ๋ฐ๋์ ํ์ํ ๊ฒฝ์ฐ์๋ ๋ง์ง ์๊ฒ ์ง๋ง ๊ทธ ๊ฒฝ์ฐ๋ฅผ ๋นผ๊ณ ์๊ฐํ์๋ค. 12345textarea#chatBot(class='form-control' style='resize:none; width:340px; height:300px;' name='chatBot' readonly='readonly') bot : ์๋ ๋ด๊ฐ ๋์์ค๊ฒ!ptextarea#chatUser(class='form-control' style='resize:none; width:340px; height:50;' name='chatUser')pinput#chatPost(type='button' value='๋ณด๋ด๊ธฐ' class..
textarea ์ ์ต์ ์์ด ๊ธฐ๋ณธ์์ฑํ๋ฉด Tabํค๊ฐ ๋จน์ง ์๋๋ค. Tabํค๋ฅผ ์ ์ฉํ๊ธฐ ์ํ ๊ตฌ๋ฌธ์ด๋ค. 12Colored by Color Scriptercs ๊ธฐ๋ณธ html textarea ์ ์ด ๊ตฌ๋ฌธ์ ์ฃผ๋ฉด ํญํค๊ฐ ์ ์ฉ๋๋ค. ์ฐธ๊ณ ๋ก pug ํ ํ๋ฆฟ ์์ง์์๋ 1textarea(onkeydown="if(event.keyCode===9){var v=this.value,s=this.selectionStart,e=this.selectionEnd;this.value=v.substring(0, s)+'\t'+v.substring(e);this.selectionStart=this.selectionEnd=s+1;return false;}")cs ์ผ๋ก ์ฌ์ฉํด์ฃผ๋ฉด ๋๋ค.
์๋ฐ์คํฌ๋ฆฝํธ์์ textarea์ ์ ๋ ฅ๋ฐ์ ๋ฌธ์์ด ํน์ ๊ฐ๋ค์ ๋๊ฐ์ด ๋ณด์ฌ์ฃผ๊ณ ์ถ์ ๋ (์๋ฅผ๋ค๋ฉด ์ํฐ๋ก ์ค๋ฐ๊ฟ์ ํด์ ์ ๋ ฅํ์ผ๋ฉด ๊ทธ ์ฌํญ๊น์ง ๋๊ฐ์ด ๊ฐ์ ธ๊ฐ ์ ์๊ฒ) ๊ตฌ๊ธ๋ง ํ๋ค๋ณด๋ฉด replace๋ฅผ ์ฐ๋ผ๋ ๋ง์ด ๋ง์๋๋ฐ ๋ด๊ฐ ํด๋ณด๋๊น ๋ฑ ํ๋ฒ๋ง ๊ฐํ๋๊ณ ๊ทธ ๋ค์๋ถํด ๊ฐํ์ด ๋จน์ง ์๋๋ค. ๊ทธ๋ฆฌ๊ณ replaceAll์ด๋ผ๋ ๋ฉ์๋๋ ์๋ง js์์ ์ ๊ณต์ ์ํด์ฃผ๋ ๊ฒ ๊ฐ๋ค. ๋ด๊ฐ ์์ ์ค๋ช ํ ๊ฑธ ๊ฐ๋จํ๊ฒ ๊ทธ๋ฆผ์ผ๋ก ๋ณด์ฌ์ฃผ์๋ฉด์ด๋ฐ textarea ์ฐฝ์ ์ ๋ฐ ์์ผ๋ก ์ ๋ ฅํ๊ณ ์ ์ก์ ๋๋ฅด๋ฉด ์ด๋ฐ์์ผ๋ก ์ ์ก๋๊ฒ ํ๋ ์์ด๊ณ ์ด ํ๋ฉด์ ์์ค๋ณด๊ธฐ๋ฅผ ๋๋ฅด๋ฉด #include int main() { printf("ddd"); return 0; } ์ ๊ฐ์ด ๊ฐํ์ฒ๋ฆฌ๊ฐ ๋ ์ํ๋ก ์์ค๊ฐ ๋์ค๊ฒ ๋๋ค. html ๊ธฐ๋ณธ ํผ ์ค๋ช ์ ์๋ต..
- Total
- Today
- Yesterday
- ํ๋ก๊ทธ๋๋จธ์ค
- typeorm
- ์๊ณ ๋ฆฌ์ฆ
- foreignkey
- node.js backend
- nestjs directory
- nestjs module
- nestjs typeorm
- nestjs doc
- backend-framework
- nestjs config
- android
- Spring Async
- node.js
- DeferredResult
- docker mysql
- Promise error
- JavaScript
- Promise bulk
- typeorm ์ฐ๊ฒฐ
- Spring
- nestjs/cli
- nestjs configService
- Request_Limit_Exceeded
- sequelize
- NestJS
- nestjs project
- ๊ธฐ์์ฒญAPI
- @nestjs/config
- ๋น๋๊ธฐ ์์ฒญ
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |