차근차근/JAVA Script

JavaScript Assignment

예쁜꽃이피었으면 2016. 2. 15. 14:21

http://www.w3schools.com/js/js_assignment.asp


JavaScript Assignment


JavaScript Assignment Operators

Assignment operators assign values to JavaScript variables.

OperatorExampleSame As
=x = yx = y
+=x += yx = x + y
-=x -= yx = x - y
*=x *= yx = x * y
/=x /= yx = x / y
%=x %= yx = x % y

The = assignment operator assigns a value to a variable.

Assignment

var x = 10;
Try it Yourself »

The += assignment operator adds a value to a variable.

Assignment

var x = 10;
x += 5;
Try it Yourself »

The -= assignment operator subtracts a value from a variable.

Assignment

var x = 10;
x -= 5;
Try it Yourself »

The *= assignment operator multiplies a variable.

Assignment

var x = 10;
x *= 5;
Try it Yourself »

The /= assignment divides a variable.

Assignment

var x = 10;
x /= 5;
Try it Yourself »

The %= assignment operator assigns a remainder to a variable.

Assignment

var x = 10;
x %= 5;
Try it Yourself »

Test Yourself with Exercises!

Exercise 1 »  Exercise 2 »  Exercise 3 »  Exercise 4 »  Exercise 5 »










반응형

'차근차근 > JAVA Script' 카테고리의 다른 글

JavaScript Functions  (0) 2016.02.15
JavaScript Data Types  (0) 2016.02.15
JavaScript Arithmetic  (0) 2016.02.15
JavaScript Operators  (0) 2016.02.15
JavaScript Variables  (0) 2016.02.15