참고 [JS] primitive value JS에서의 primitive JS에서의 primitive value는 객체도 아니고, 메소드도 없는 값이다. JS의 primitive value는 다음과 같다.(ecma2020 기준) string number bigint boolean null undefined symbol 모든 primitiv.. ingnoh.tistory.com symbol은 primitive value이므로, 결국은 symbol 형식의 '값'이다! Symbol()로부터 반환되는 모든 symbol 값은 고유하다. symbol 값은 객체 프로퍼티로 사용될 수 있으며, 사실상 이것이 symbol의 유일한 목적이라고 함. 이를 통해, 같은 형식의 여러 오브젝트를 식별하는 식별자 역할을 수행할 수 ..
JS에서의 primitive JS에서의 primitive value는 객체도 아니고, 메소드도 없는 값이다. JS의 primitive value는 다음과 같다.(ecma2020 기준) string number bigint boolean null undefined symbol 모든 primitive 값은 불변하여 변형할 수 없다. 변수에 값을 할당하는 행위와 값 자체를 혼동하지 않아야 한다! JS에서의 wrapper null과 undefined를 제외하고, 모든 primitive value는 래퍼 객체를 갖는다. String Number BigInt Boolean Symbol const num = 123; const numObj = Number(123); const strObj = String(123); ..
이게 best Practice인지는 모르겠음. const getAjax = function(url) { return new Promise((resolve, reject) => { // 1. $.ajax({ url: url, type: "GET", dataType: "json", data: { ascending: false, max: 20, }, success: (res) => { resolve(res); // 2. }, error: (e) => { reject(e); // 3. } }); }); } $(document).on('click', "#btnId", async () => { // 4. try { const { token, items } = await getAjax(url); // 5. // to..
참고. 전개 구문 - JavaScript | MDN 전개 구문 전개 구문을 사용하면 배열이나 문자열과 같이 반복 가능한 문자를 0개 이상의 인수 (함수로 호출할 경우) 또는 요소 (배열 리터럴의 경우)로 확장하여, 0개 이상의 키-값의 쌍으로 객 developer.mozilla.org 전개 구문(spread syntax)을 활용하면 쉽다. function spreadFunc(...args) { console.log(args); } spreadFunc(); spreadFunc(1); spreadFunc(1, 2, 3); spreadFunc('a', 1, {}); /* 실행 결과 [] [ 1 ] [ 1, 2, 3 ] [ 'a', 1, {} ] */ 매개 변수는 전개 구문과 일반 변수를 혼용할 수 있다. fu..

참고. airbnbのjavascript eslintで快適WebStorm生活! - Qiita 概要 プライベートなReactNativeアプリ開発、せっかくなので有名どころのコーディングスタイルを試してみようと思い、WebStormへの導入過程をまとめました。 Style選定 好み&決めの問題なので qiita.com // macOS 기준 npm i --g eslint npm i eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-import --save-dev vi .eslintrc.json /* { "extends": "airbnb" } */ preference > eslint 검색시 JavaScript > Code Quality Tool..
[JS] Airbnb 스타일 가이드 1 - 8. 참고 airbnb/javascript JavaScript Style Guide. Contribute to airbnb/javascript development by creating an account on GitHub. github.com 더 사용이 잦을 것으로 보이는 항목부터 실습하였음. 아래의 내용.. ingnoh.tistory.com 특정한 객체 프로퍼티를 변수에 할당하고자 하는 경우, 나는 습관적으로 다음과 같이 작성하곤 했다. let obj = { title: 'ingnoh', description: 'code monkey', } // 중략... let title = obj.title; let description = obj.description;..
참고용 const str = "i am ingnoh hong"; const chars = str.split(''); /* const chars = Array.from(str); Array.from을 사용할 수도 있다. */ /* const chars = [...str]; 전개연산자를 사용할 수도 있다. 추천함! */ const terms = str.split(' '); // 글자 단위 배열 console.log(chars); // 단어 단위 배열 console.log(terms); /* 실행 결과 [ 'i', ' ', 'a', 'm', ' ', 'i', 'n', 'g', 'n', 'o', 'h', ' ', 'h', 'o', 'n', 'g' ] [ 'i', 'am', 'ingnoh', 'hong' ] */
참고 airbnb/javascript JavaScript Style Guide. Contribute to airbnb/javascript development by creating an account on GitHub. github.com 더 사용이 잦을 것으로 보이는 항목부터 실습하였음. 아래의 내용은 '모든 JS 개발자가 이렇게 한다!'가 아닌 Airbnb의 작성 가이드를 repl.it에서 따라한 결과(안 따라한 것도 많음) 적절히 참고할 것 :D 1. Types Use const for all of your references; avoid using var. 모든 참조는 const를 사용하고, var를 지양합니다. 이는 재할당으로부터 비롯되는 버그, 또는 이해하기 어려운 코드의 사용을 방지해줍니다...
- Total
- Today
- Yesterday
- etc
- Java
- jQuery
- RancherDesktop
- JEST
- javascript
- Gradle
- pgloader
- shell
- spring boot
- hashicorp
- terraform
- Git
- mysql
- IntelliJ
- 코딩테스트
- Database
- Vault
- JPA
- kotlin
- postgresql
- Docker
- Linux
- Puppeteer
- eureka
- AWS
- Node.js
- react
- Spring Cloud Config
- AWS IoT
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |