web116 Javascript arrow function expression # Javascript arrow function expression #### Reference - [arrow function developer.mozilla.org :](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Functions/%EC%95%A0%EB%A1%9C%EC%9A%B0_%ED%8E%91%EC%85%98) #### 화살표 함수 표현(arrow function expression) - function 표현에 비해 구문이 짧고 - 자신의 this, arguments, super 또는 new.target을 바인딩 하지 않습니다. - 화살표 함수는 항상 익명입니다. - 이 함수 표현은 메소드 함수가 아닌 곳에 가장 적당합니다. -.. 2019. 7. 12. Replace Tag(Script & div & B tag to strong) # replace tag ( B tag to strong ) ```javascript String.prototype.replaceTag = function(a,b) { var input = a.join("|"); debugger; var reg = new RegExp( '"\']|"[^"]*"|\'[^\']*\')*)>',"gim"); if(reg.test(this)){ console.info( 'ok' ); //alert ( 'ok' ); } //alert(input.replace(reg,"")); //console.info(this.replace(reg,"")); return this.replace(reg,""); } console.info("\n\n\n\n\n\n" .replaceTag(["scri.. 2019. 7. 12. bind click event loop index Click Me! Click Me! Click Me! Click Me! Click Me! Click Me! var g = document.getElementById('my_div'); for (var i = 0, len = g.children.length; i < len; i++) { (function(index){ g.children[i].onclick = function(){ alert(index) ; } })(i); } https://jsfiddle.net/softm/en067grx/ 2019. 7. 12. create line to svg # create line to svg ##### [source : https://jsfiddle.net/softm/tufpj6gx/ ](https://jsfiddle.net/softm/tufpj6gx/) ```html ``` 2019. 7. 12. Javascript Async, Await 심화 # Javascript Async, Await 심화 ```javascript // wait ms milliseconds function wait(ms) { return new Promise(r => setTimeout(r, ms)); } async function hello() { await wait(1500); return 'world'; } hello() .then(function(r,j){ console.info(r,j); }) .catch(function(e){ console.info(e); }); // ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== // wait ms milliseconds function wait(ms) { return new.. 2019. 7. 12. SVG, JS, CSS로 만드는 라이언 로그인 폼 # SVG, JS, CSS로 만드는 라이언 로그인 폼 ### [원본 : https://taegon.kim/archives/9658](https://taegon.kim/archives/9658) ##### [source : https://jsfiddle.net/softm/by01n23u/ ](https://jsfiddle.net/softm/by01n23u/) ```html ``` ```css body { background: #3d516b; } form { width: 320px; padding: 60px 25px 80px; margin: 50px auto; background: #f8d348; display: flex; flex-direction: column; } svg { width: 70%; bor.. 2019. 7. 12. 이전 1 ··· 9 10 11 12 13 14 15 ··· 20 다음