본문으로 바로가기

자바스크립트 연습문제(변수)

category IT/자바스크립트 2020. 1. 12. 22:11
반응형

변수


Exercise1

변수명을 carName 값을 VolvocarName이라는 변수를 작성하고 Volvo 값을 지정하십시오.

Create a variable called carName, assign the value Volvo to it.

var       = "       ";

 

Exercise2

x라는 변수를 작성하고 값 50을 지정하십시오.

Create a variable called x, assign the value 50 to it.

var     =        ;

 

Exercise3

두 개의 변수 x와 y를 사용하여 5 + 10의 합을 표시합니다.

Display the sum of 5 + 10, using two variables: x and y.

var =      ;

var y = 10;

document.getElementById("demo").innerHTML = x y;

Exercise4

z라는 변수를 작성하고 x + y를 지정하고 결과를 경고 상자에 표시하십시오.

Create a variable called z, assign x + y to it, and display the result in an alert box.

var x = 5;

var y = 10;

       = x + y;

       (z);

Exercise5

한 줄에 다음 이름과 값으로 세 개의 변수를 선언하십시오.

On one single line, declare three variables with the following names and values:

firstName = "John"
lastName = "Doe"
age = 35

var = "John"  

lastName =           

           ;

 

 

반응형