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
//http://ejohn.org/blog/asmjs-javascript-compile-target/ | |
function DiagModule(stdlib, foreign, heap) { | |
//"use asm"; | |
// Variable Declarations | |
var sqrt = stdlib.Math.sqrt; | |
// Function Declarations |
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
<div id="view"> | |
<div id="content"> | |
<div class="original"> | |
<div class="a">a</div> | |
<div class="b">b</div> | |
<div class="c">c</div> | |
</div> | |
<div class="addon"> |
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
// 초기 코드에서 이걸 계산. | |
this.__d = []; | |
for (i in window) { | |
this.__d.push(i); | |
} | |
//나중에 이 메소드를 실행 | |
(function(win){ |
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
<div id="wrap"></div> |
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
<html> | |
<body> | |
<div>a</div> | |
</body> | |
</html> | |
<script> | |
try { | |
var a; | |
a.push(); |
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
<div id="first"><span>first span</span></div> | |
<div id="two"></div> |
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
function setVariables(obj) { | |
var o = {}; | |
for(var myKey in obj) { | |
o[myKey] = document.querySelector(obj[myKey]); | |
} | |
return o; | |
} | |
var _v = setVariables({ |
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 arr = [1,2,3,[4,5,[4,6,[4,5,[5,[5,[6,100,[21]]]]]]]]; | |
var result = (function getSum(arr) { | |
var sum = arr.reduce(function(pre,cur,i,o){ | |
if(typeof cur !== "number") { | |
return pre + getSum(cur); | |
} | |
return pre+cur; | |
}); |
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
function TA() { | |
this.ele = document.querySelector("#message"); | |
this._attachEvents(); | |
} | |
TA.prototype = { | |
_handlers : { | |
click : '_clickHandler', | |
mousedown : '_mousedownHandler', /* test */ | |
touchstart: '_touchHandler',/* test */ |
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
//thin 'Object.create()' | |
function JClass(parentProto) { | |
var fun = new Function(); | |
fun.prototype = parentProto; | |
return new fun(); | |
} | |
// Parent function | |
function ESS(name) { | |
this.comma = ","; |