This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//forked from "https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API" | |
window.requestIdleCallbackCustom = function(handler) { | |
let startTime = Date.now(); | |
return setTimeout(function() { | |
handler({ | |
didTimeout: false, | |
timeRemaining: function() { | |
return Math.max(0, 50.0 - (Date.now() - startTime)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SimplePromise | |
function SimplePromise(fn){ | |
let resolveData = null; | |
let rejectData = null; | |
let thenCallback = null; | |
const resolve = function(resultData) { | |
resolveData = resultData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<meta charset="utf-8"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Untitled</title> | |
<style> | |
h1 { | |
color: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-----------------+ | |
| Tables_in_jsman | | |
+-----------------+ | |
| articles | | |
| movie | | |
| newspaper | | |
| user | | |
+-----------------+ | |
4 rows in set (0.00 sec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1.dev. | |
{ | |
test: /\.less$/, | |
include: paths.appSrc, | |
loaders: ["style", "css", "less", "postcss"] | |
} | |
//2, production | |
{ | |
test: /\.less$/, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var news = [ | |
{ | |
"title" : "sbs", | |
"imgurl" : "http://static.naver.net/newsstand/2017/0313/article_img/9054/173200/001.jpg", | |
"newslist" : [ | |
"[가보니] 가상 경주도 즐기고, 내 손으로 자동차도 만들고", | |
"리캡차'가 사라진다", | |
"갤럭시S8' 출시? '갤노트7' 처리 계획부터 밝혀야", | |
"블로코-삼성SDS, 블록체인 사업 '맞손", | |
"[블록체인 톺아보기] 퍼블릭 블록체인의 한계와 프라이빗 블록체인" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let ws = new WeakSet(); | |
let a = [1,2,3]; | |
ws.add(a); | |
console.log(ws.has(a)); //true | |
a = null; | |
console.log(ws.has(a)); //false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var news = [ | |
{ | |
"title" : "sbs", | |
"imgurl" : "http://static.naver.net/newsstand/2017/0313/article_img/9054/173200/001.jpg", | |
"newslist" : [ | |
"[가보니] 가상 경주도 즐기고, 내 손으로 자동차도 만들고", | |
"리캡차'가 사라진다", | |
"갤럭시S8' 출시? '갤노트7' 처리 계획부터 밝혀야", | |
"블로코-삼성SDS, 블록체인 사업 '맞손", | |
"[블록체인 톺아보기] 퍼블릭 블록체인의 한계와 프라이빗 블록체인" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//참조를 유지하기 때문에 이전데이터와 현재데이터는 당연히 같다. | |
var originData = [1,2,"foo","bar"]; | |
var newData = originData; | |
console.log(originData === newData) //true | |
newData[0] = 3; | |
console.log(newData[0] === originData[0]); //true | |
//이전데이터와 새로운데이터간의 비교가 필요하다면, 참조를 유지하지 않고 새로운 데이터를 만들어내야 한다. | |
//immutable array 를 유지하는 방법. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const name = "nayoun"; | |
const age = 9; | |
const others = { | |
address : "kwang myeung city", | |
tel : null, | |
height: 130 | |
} | |
const data = { | |
name, |