📜 Js

    [JavaScript] 프로토타입 쓰는 이유, 목적 그리고 사용법

    사용 목적 프로토타입은 자바스크립트의 최적화를 위해 사용된다. 사용 방식 자바스크립트는 아래와 같이 함수형으로 객체 생성이 가능하다. function Person(first, last, age, eyecolor) { this.firstName = first; this.lastName = last; this.age = age; this.eyeColor = eyecolor; } const myFather = new Person("John", "Doe", 50, "blue"); const myMother = new Person("Sally", "Rally", 48, "green"); 여기서 국적(nationality)이라는 변수를 하나 더 만들어보자. function Person(first, last, age..

    React를 이용한 다른 색깔 찾기 게임 Clone Coding

    리액트를 한번 경험해보고자 했었고 결과적으로 하길 잘했다는 생각이 들었다. 작업시간이 그렇게 오래걸리지 않았고 오히려 새로운 언어 형식이라 흥미로웠다. 추후에 시간이 된다면 Next.js를 한번 다뤄보고싶다. React App find-color-game.vercel.app GitHub - Clockingjun/find-color-game Contribute to Clockingjun/find-color-game development by creating an account on GitHub. github.com 설계 과정에서 헤맸던 문제 맨바닥에서 시작하려다보니 개념적인 부분에서 머리를 너무 많이 굴렸다. 결과적으로는 컴포넌트를 총 3개를 만들었고 데이터를 공유하기 위해서 게임판에서 모든 데이터를 만들..

    alert 위치 모를때 위치 찾는 법

    alert이 뜨긴 뜨는데 어디서 뜨는지 모를 때.. 콘솔 or 소스에 아래 코드 입력하면 alert 위치 탐색 가능 var old = alert; alert = function() { console.log(new Error().stack); old.apply(window, arguments); };

    [ES6] Ajax(Callback, Promise, Async&Await)

    Ajax는 전체페이지를 리로드 하지 않고 페이지의 일부분만 동적으로 변환시키기 위해 사용한다. Ajax를 사용할 땐 꼭 비동기식을 사용해야하는데 이유는 이렇다. "It's asynchronous in that it doesn't lock up the browser." "브라우저를 잠그지 않는다는 점에서 비동기식입니다." Ajax를 호출 시에 브라우저가 멈추지 않는다는 뜻이다. Ajax의 특징은 이만하면 됐고 기술론적 이야기를 해보자. 1. CallBack $.ajax({ url: "input url_1", type: "post", data: data, success: function(res_1) { $.ajax({ //콜백지옥 url: "input url_2", type: "post", data: res..