This file contains hidden or 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 f(str, seperator, limit) { | |
// split string by limit | |
// .split eventually add one more elements. | |
let arr = str.split(seperator, limit); | |
if(typeof limit === "number") { | |
// find last element's index, push it to the original array | |
let index = arr.reduce(function(prev, curr, i){ | |
return str.indexOf(curr, prev); | |
}, 0); |
This file contains hidden or 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 delay(expressionAsFunction) { | |
var result; | |
var isEvaluated = false; | |
return function () { | |
if (!isEvaluated) | |
result = expressionAsFunction(); | |
return result; | |
}; | |
} |
This file contains hidden or 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
/* | |
* 파일 이름, 목적, 작성자, 저작권 정보 및 기타 등등 적는곳 | |
* | |
* module_template.js | |
* Template for browser feature modules | |
* | |
* Original Author | |
* Michael S. Mikowski - [email protected] | |
* Copyright (c) 2011-2012 Manning Publications Co. | |
*/ |