본문 바로가기

Front-end

(97)
JavaScript - Map() map은 forEach와 마찬가지로 Array의 각 요소를 순회하며 callback 함수를 실행합니다. 다만, callback에서 return 되는 값을 배열로 만들어냅니다. 1. [].map(callback, thisArg) 기본적인 map의 사용법은 아래와 같습니다. const arr = [0,1,2,3]; let squaredArr = arr.map(function(element){ return element * element; }); // 혹은 arrow 함수 가능 squaredArr = arr.map(element => element * element); console.log(squaredArr); // [ 0, 1, 4, 9 ] 위 코드를 보면 배열 속 숫자들이 제곱되어 새로운 배열이 생성되는..
React - Cocktails
리액트 리덕스 (Redux) 튜토리얼 https://youtu.be/wSbjROmXTaY
codecademy - HTML, CSS, JavaScript 코스 HTML, CSS ,JavaScript 이해도를 높이기위해 Codecademy코스를 시작했다 학원, 유튜브로 공부를 했지만 다시한번 반복하고 확실히 이해하기위해 수업을 듣기시작했다 가장 기본적인 HTML, CSS, JavaScript를 잘 다룰수 있어야 진정한 프론트엔드 개발자라는 많은 사람들의 조언이 있었다 아직은 클론코딩으로 웹사이트를 만드는 수준이지만 계속 실력을 쌓아서 스스로 모든 사이트를 만들 수 있도록 노력해야겠다.
React Life Cycle 정리 React Life Cycle 정리 리액트 라이프 사이클이란? 리액트의 각 컴포넌트는 라이프사이클을 가진다. 리액트를 사용해 화면에 뷰가 그려지는 과정은 단순히 보았을때 컴포넌트를 작성한다. 컴포넌트를 ReactDOM.render()를 이용해 그려낸다. const App = () => { return ( Hello World ); }; ReactDOM.render(, document.querySelector("#root")); App이라는 컴포넌트가 DOM에 그려지고 없어지기 까지 과정(Life Cycle)이 있고 리액트에선 이 과정 중 하고싶은 일을 정의 하게 해 줄 수 있다. 어떻게? LifeCycle Methods를 이용해서 Source: https://github.com/wojtekmaj/reac..
Arrow Functions ES6 introduced arrow function syntax, a shorter way to write functions by using the special “fat arrow” () => notation. Arrow functions remove the need to type out the keyword function every time you need to create a function. Instead, you first include the parameters inside the ( ) and then add an arrow => that points to the function body surrounded in { } like this: const rectangleArea = (widt..
Return When a function is called, the computer will run through the function’s code and evaluate the result of calling the function. By default that resulting value is undefined. function rectangleArea(width, height) { let area = width * height; } console.log(rectangleArea(5, 7)) // Prints undefined In the code example, we defined our function to calculate the area of a width and height parameter. Then..
Parameters and Arguments some functions can take inputs and use the inputs to perform a task. When declaring a function, we can specify its parameters. Parameters allow functions to accept input(s) and perform a task using the input(s). We use parameters as placeholders for information that will be passed to the function when it is called. Let’s observe how to specify parameters in our function declaration: In the diagr..