JavaScript 6

자바스크립트. 함수 리턴

DOCTYPE html> Document //case2 function return100() { //return100 이라는 함수를 호출하면, return 100; //100을 반환시켜준다. } var n2 = return100(); //n2 변수에 return100()함수를 담아준다. documenr.write(n2); //담은 함수는 100이 반환되니, 출력시 100이 출력 //case3 function return50plus60() { //return50plus60 이라는 함수를 호출하면, return 50 + 60; //50+60 값이 반환된다. } var n3 = return50plus60(); //변수에 함수를 담고, document.write(n3); // 변수를 출력 시 110이 나온다. ..

[자바스크립트] 가위바위보 게임

index.html DOCTYPE html> Document 가위 바위 보 게임 유저 이미지 컴퓨터 index.css #top{ width : 800px; height : 100px; background-color: red; } #left{ width : 100px; height : 700px; float : left; background-color: yellow; } #mid{ width : 700px; height : 700px; float : left; background-color: orange; } #mid_top{ width : 700px; height : 200px; background-color: aqua; text-align: center; line-height: 150px; float ..

[자바스크립트] 주사위게임

//todo : *. 주사위 노름 만들기 /*************************************************** * 전역 변수 ***************************************************/ var playerDiceValue; var computerDiceValue; /*************************************************** * 함수 선언한 것들 ***************************************************/ function playerDice() { //todo : 유저 주사위 처리 playerDiceValue = prompt("1부터6까지 숫자를 선택 해주세요."); //docum..