javascript 정규식에서 global flag 사용하면 정규식 객체가 lastIndex를 유지
javascript 정규식에서 global flag 사용하면 정규식 객체가 lastIndex를 유지? 한다는걸 저만 몰랐나요? ^^;; http://stackoverflow.com/questions/6891545/javascript-regexp-test-returns-false-even-though-it-should-return-true This is a common behavior that the the exec or test methods show when you deal with patterns that have the global g flag.The RegExp object will keep track of the lastIndex where a match was found, and then on..
IT/JavaScript
2014. 11. 26. 10:20
ECMAScript 6: what’s next for JavaScript? (August 2014)
IT/JavaScript
2014. 9. 2. 17:42
JavaScript todomvc
http://todomvc.com/
IT/JavaScript
2014. 7. 21. 16:15
byte length count
for(b = i = 0 ; c = s.charCodeAt(i++) ; b += c>>7 ? 2 : 1) {return b;} value로 부터 50자리 문자 깨짐 없이 가져오기value = (function(s, b, i, c){for(b = i = 0 ; c = s.charCodeAt(i++) ; b += c>>7 ? 2 : 1){if(b == 50){return s.substring(0, i - 1); }else if(b == 51){return s.substring(0, i - 2); }}return s;})(value);
IT/JavaScript
2014. 7. 21. 15:00