본문 바로가기

전체 글50

React Tutorial https://reactjs.org/tutorial/tutorial.html#help-im-stuck Tutorial: Intro to React – React A JavaScript library for building user interfaces reactjs.org we want the Square component to “remember” that it got clicked, and fill it with an “X” mark. To “remember” things, components use state. React components can have state by setting this.state in their constructors. this.state should be considered.. 2020. 3. 21.
JSX https://reactjs.org/docs/introducing-jsx.html Introducing JSX – React A JavaScript library for building user interfaces reactjs.org JSX Prevents Injection Attacks Specifying Children with JSX Specifying Attributes with JSX ( use camelCase) Babel compiles JSX down to React.createElement() calls. 셋다 같은 문장 'React elements' const element = ( Hello, world! ); const element = React.createElement( 'h1'.. 2020. 3. 20.
인사이드 자바스크립트 자바스크립트 핵심 개념 객체 : null과 undefined를 제외한 모든 것은 객체로 다룰 수 있다. 함수 : 일반적인 객체보다 조금 더 많은 기능이 있는 일급 객체 프로토타입 : 숨겨진 링크로 해당 객체를 생성한 생성자의 프로토타입 객체를 가리킨다. 실행 컨텐스트와 클로저 : 실행 컨텍스트는 자신만의 유효 범위를 가지고 이 과정에서 클로저를 구현할 수 있다. 자바스크립트 단점 느슨한 타입 체크로 인한 런타임 오류 전역 객체로 인한 이름 충돌의 위험성 브라우저 독립적인 코드 구현의 어려움 자바스크립트 기본 타입 숫자 모든 숫자를 64비트 부동소수점 형태로 저장, C언어의 double타입과 유사 5/2 = 2.5가 결과값으로 출력됨 Math.floor()을 사용해 소수 부분을 버릴 수 있음 문자열 배열 .. 2020. 3. 10.
margin-left: -1 or margin-right: -1 border 값이 겹치는 부분을 시각적으로 없는 것처럼 보이기 위해 쓴다. 2020. 3. 9.
img태그 srcset 속성 이미지 불러오기로 인한 트래픽 문제 해결 이미지가 흐릿하게 보이는 형상과 깨짐 현상 해결 이미지 최적화 2020. 3. 9.
JavaScript(2) Promise : 자바스크립트 비동기 처리에 사용되는 객체로 생성자를 통해서 프로미스 객체를 만들수 있고 생성자의 인자로 executor 함수를 사용한다. executor함수는 resolve와 reject함수를 인자로 가진다. 생성자를 통해서 객체를 만드는 순간을 대기(pending) 상태라고 한다. resolve함수를 실행하면 이행(fulfilled) 상태가 된다. reject함수를 실행하면, 거부(rejected) 상태가 된다. * 비동기 처리 : 특정 코드의 실행이 완료될 떄까지 기다리지 않고 다음 코드를 먼저 수행하는 자바스크립트의 특성 new Promise((resolve,reject)=>{ // executor resolve(); // fulfilled reject(); // rejected .. 2020. 2. 6.