Dev/javascript

    gulp 로 코드 minify & uglify + map 파일 만들기

    https://blackblackblackblack.tistory.com/entry/%EC%BD%94%EB%93%9C-minify-%EB%82%9C%EB%8F%85%ED%99%94 코드 minify + 난독화 업체에 알려지면 안된다고 해서 https://skalman.github.io/UglifyJS-online/ UglifyJS 3: Online JavaScript minifier // Documentation of the options is available at https://github.com/mishoo/UglifyJS2 { parse: { bare_returns : false, ecma : 8, expr jinwoochoi.com 이걸로 전달했더니 어렵다고 이번에는 minify 만 해달라고 한..

    [vue] 처음 시작해보기 메모

    https://ryu-e.tistory.com/44 2. Vue CLI로 Vue 프로젝트 생성하기 Vue CLI는 Vue 프로젝트를 빠르게 구성하고, 빌드, 디플로이 할 수 있게 도와주는 도구입니다. 우선 CLI 설치를 해보고 프로젝트를 설치하는 3가지 방법에 대해서 알아봅시다. 처음에는 Default 옵션 ryu-e.tistory.com https://github.com/vuejs/vue-cli/issues/3424 Vue CLI fails on Windows Powershell · Issue #3424 · vuejs/vue-cli Version 3.4.0 Environment info Environment Info: System: OS: Windows 10 CPU: (16) x64 AMD Ryzen ..

    map안에서 if쓸때

    https://velog.io/@dregonc/map%EC%97%90-if%EB%AC%B8

    Object.create() 란

    Object.create() 란

    ES5 Object.create() 는 ES5 문법입니다. ES6 에서는 new 문법을 사용합니다. The Object.create() method creates a new object, using an existing object as the prototype of the newly created object. 새로 생성될 객체의 프로토타입 객체를 넣어주면, 새로운 객체가 생성됩니다. 아래의 예제를 보면 어떻게 작동하는지 쉽게 알수있습니다. const person = { isHuman: false, printIntroduction: function () { console.log(`My name is ${this.name}. Am I human? ${this.isHuman}`); } }; const me..

    JavaScript assign 문법

    JavaScript assign 문법

    a = { a: '1', b: '2', c: '3' } // {a: "1", b: "2", c: "3"} Object.assign(a, function () { return { d: '4' }; }()); // {a: "1", b: "2", c: "3", d: "4"} Object.assign(a, {e: '5'}); // {a: "1", b: "2", c: "3", d: "4", e: "5"} Object.assign(a, {f: function() { return 'hello'}}); /* a: "1" b: "2" c: "3" d: "4" e: "5" f: ƒ () */ Object.assign(a, {g: function() { return 'hello'}()}); /* a: "1" b: "2" c..

    Arrow function과 lexical binding

    Arrow function과 lexical binding

    function을 콜백으로 쓸때 스코프가 달라져서 this를 다른데 옮기거나, bind 함수를 사용했었다. const that = this; app.assets.loadFromUrl('path/file', 'material', function (err, asset) { that.shadow.model.material = asset.resource; }); 이런식이나 app.assets.loadFromUrl('path/file', 'material', function (err, asset) { this.shadow.model.material = asset.resource; }.bind(this)); 이렇게 사용했는데 그냥 Arrow function 쓰면 렉시컬 스코프(선언되는 위치가 중요)로 바인딩되서 위..

    function 선언 방식별 차이점(함수 선언식, 표현식)

    function 선언 방식별 차이점(함수 선언식, 표현식)

    오늘 회사에서 코딩하고 있는데, 누가 두개의 차이점을 물어봤다. 함수 선언식 function sayHello() { console.log('Hello'); } 함수 표현식 var sayHello = function() { console.log('Hello'); } 함수 표현식은 호이스팅에 영향을 받지않는다. 그래서 클로져나 콜백으로 자주 사용된다. joshua1988.github.io/web-development/javascript/function-expressions-vs-declarations/ 함수 표현식 vs 함수 선언식 (기본) 자바스크립트 함수 표현식과 함수 선언식에는 어떠한 차이점이 있는지 알아봅니다. joshua1988.github.io