본문 바로가기

자바 스크립트16

javascript foreach , map , reduce javascript 에서 배열과 관련된 반복문은 3개가 있다. 각각의 반복문을 사용해서 구구단을 만들면 이렇다. foreach 123[...Array(9)].forEach((item,index) => { resultString += `${num}*${index + 1}=${num * (index + 1)} `; });Colored by Color Scriptercs map 123[...Array(9)].map( (value, idx) => `${num} * ${idx + 1} = ${num * (idx + 1)}` );Colored by Color Scriptercs reduce 1234[...Array(9)].reduce( (acc,cur,idx) => `${acc} ${num}*${idx + 1}=$.. 2018. 10. 10.
쉽게 시작하는 Nodejs 1편 쉽게 시작하는 Nodejs 1편 node js 코드 실행하기 먼저 Bracket을 실행하고 플러그인 설치를 클릭합니다. 플러그인들을 설치합니다. 코드를 작성하고 저장했습니다. Add node js 를 클릭하고 test1.js 를 선택한 다음 실행을 클릭합니다. 소스코드가 실행 된 것을 확인 할 수 있습니다. 2018. 3. 17.
html 경고창 , 현재 시간 출력 예제 html 예제 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 콜백함수a // 콜백함수 ; 함수를 하나의 자료형처럼 취급 // 즉 함수를 다른 함수의 매개변수로 사용 function send_go() { setTimeout(function() { alert("경고메세지") ; }, 3000); } function send_go2() { var now = new Date(); var s = now.getFullYear()+". " + (now.getMonth()+1)+". "+ now.getDate()+" "+ now.getHours()+" : " + now.getMinutes()+" : "+now... 2017. 12. 6.
html 예제 html 예제 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 Insert title here document.write(" Math Method "); document.write("2의 10승 : "+Math.pow(2,10)+" "); document.write("3,25,9,47,2,5,7 중 가장 큰 수 : "+Math.max(.. 2017. 12. 6.
html 회원 정보 확인 예제 html 회원 정보 확인 예제 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 form과 function fieldset { width: 450px.. 2017. 12. 5.