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 (global, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD 환경 | |
define(['exports', 'jquery'], factory); | |
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { | |
// CommonJS 환경 | |
factory(exports, require('jquery')); | |
} else { | |
// 일반 브라우저 | |
factory((global.module1 = global.module1 || {}), global.$); |
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 (global, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(['exports'], factory); | |
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') { | |
factory(exports); | |
} else { | |
factory((global.module1 = global.module1 || {})); | |
} | |
}(this, function (exports) { | |
exports.action = function () {}; |
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 (global, factory) { | |
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | |
typeof define === 'function' && define.amd ? define(['exports'], factory) : | |
(factory((global.module1 = global.module1 || {}))); | |
}(this, (function (exports) { | |
exports.action = function () {}; | |
})); |
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 throttleFunction = (function() { | |
'use strict'; | |
var timeWindow = 500; // 여기에 시간(ms)을 지정한다 | |
var lastExecution = new Date((new Date()).getTime() - timeWindow); | |
// ES6 이하일 경우 ...args에 호출할 parameter 만큼 준다 function(arg1, arg2...) | |
var throttleFunction = function(...args) { | |
// 여기에 로직을 구현한다 | |
}; |
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 debounceFunction = (function() { | |
'use strict'; | |
var timeWindow = 500; // 여기에 시간(ms)을 지정한다 | |
var timeout; | |
// ES6 이하일 경우 ...args에 호출할 parameter 만큼 준다 function(arg1, arg2...) | |
var debounceFunction = function(...args) { | |
// 여기에 로직을 구현한다 | |
}; |
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 obj = { | |
hasOwnProperty : function(){ | |
return false; | |
}, | |
data1 : 1 | |
}; | |
for (prop in obj) { | |
// obj.hasOwnproperty(prop) 의 결과는 항상 false | |
if (obj.hasOwnproperty(prop)){ |
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
for (prop in obj) { | |
// 첫번째 방법 | |
if ({}.hasOwnProperty.call(obj, prop)) { | |
} | |
// 두번째 방법 | |
if (Object.prototype.hasOwnProperty.call(obj, prop)) { | |
} |
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 jsonReplace = function(j){ | |
if(j){ | |
j = j.replace(/\"\[/g,"\[").replace(/\]\"/g,"\]").replace(/\"\{/g,"\{").replace(/\}\"/g,"\}"); | |
} | |
return j; | |
}; |
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
SELECT SQL_CALC_FOUND_ROWS @RNUM:=@RNUM+1 AS ROWNUM, R.* FROM ( | |
SELECT @RNUM:=0, Q.* FROM ( | |
SELECT * FROM TABLE1 | |
WHERE ID = '1' | |
ORDER BY REG DESC | |
LIMIT 18446744073709551615 | |
) Q | |
) R |
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
SELECT SQL_CALC_FOUND_ROWS @RNUM:=@RNUM+1 AS ROWNUM, R.* FROM ( | |
SELECT @RNUM:=0, Q.* FROM ( | |
SELECT * FROM TABLE1 | |
WHERE ID = '1' | |
ORDER BY REG DESC | |
) Q | |
) R | |
LIMIT 0,10 |