![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bBem0d/btqxOI1oyPL/Lgkl5RipOYEDwW7w4X7vdk/img.jpg)
How does React.js work - React uses JavaScript to creates all the elements you write and pushes them to HTML. - Virtual DOM is used. It's a fast and lightweight copy. Component in React.js - Component is parts of reusable and independent code in React.js. - It does serve like JavaScript functions, but it returns HTML. - When you create React app or show data from React, you deal with Component t..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/bD8yy9/btqxFSwZTYn/A434KTG67JqZBXUbK7QKXK/img.jpg)
Download and install Node.js check node.js, npm and npx installed perfectly. Create react app To start React.js, type 'npm start' in Terminal *it should be located where the React app created. 해당 React 디렉토리에 위치하고 있어야함 Compiled successfully Works fine
Callback function Callback handles a function execution when you want a function execution right after the return of other functions. Example Code I var users = ["Megan", "Kathy", "John"]; function addUser(username){ setTimeout(function(){ users.push(username); }, 200); } function getUsers(){ setTimeout(function() { console.log(users); }, 100); } addUser("Kitty"); getUsers(); output [ 'Megan', '..
Function declaration 일반적인 함수선언 function foo() {}; Function expression 함수표현식 const foo = function(){}; Arrow function 화살표함수 const foo = () => {}; const foo = num => {}; //single parameter는 {}생략가능. ()가능. return생략가능 간단한 화살표함수의 활용 function(num){return `saved ${num}`}; //위의 내용을 arrow function을 사용하면 간단해진다 num => `saved ${num}`; //parameter가 하나고 한 줄이면 {}와 return 생략가능 *JavaScript들어가거나 multi-line string사..
자바스크립트는 함수를 만드는 것으로 선언까지 가능하게한다. 그래서 클로저(Closure) 라는 새로운 개념도 가지고 있다. Java나 다른 언어에서 였으면 scope를 벗어나서 역할이 종료가 되는 상황에서 JavaScript는 그와는 다르게 하위 function이 상위 funtion의 자원을 사용할 경우 그 scope가 종료가 되지 않는 상황이 발생할 수 있다. 이렇게 하위 function 이 자기 위의 funtion의 자원을 사용하는 것을 closure 라고 한다. Example Code function favorite(){ var fruit = "banana"; return function myType(){ return fruit; } } var fav = favorite(); var fruit = ..
JavaScript에서 this 키워드는 다른 언어에서의 this와 좀 다른 특징을 가지고 있다. Java에서는 자기자신을 나타내는 용도로 사용되기에 parameter와 속성의 이름이 같을 경우나 다른 overloading된 constructor를 불러올때 사용되는데 반해 JavaScript에서는 호출하는 방법 즉, '호출한 객체' 가 누구(무엇)냐에 따라 this가 달라진다. bind() method를 사용해 this를 고정시키는 방법도 있다. Reference https://www.youtube.com/watch?v=PAr92molMHU
- Total
- Today
- Yesterday
- easy javascript algorithm
- hackerrank
- 알고리즘
- HashMap
- javascript
- math.max
- hackerrank javascript
- 프로그래머스 알고리즘
- string class in java
- hackerrank solution
- 프로그래머스 알고리즘문제
- ... in Javascript
- rest parameter
- equals()
- HackerRank Algorithm
- easy algorithm
- C++
- code refactoring
- 프로그래머스
- compareTo()
- Javascript Algorithm
- spring boot application
- java
- repeat()
- substring()
- Object type casting
- algorithm
- hackerrank javascript solution
- math.abs
- Collection Framework
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |