반응형
<!DOCTYPE html>
<html>
<body>
<h2>The * Operator</h2>
<p id="demo"></p>
<script>
var x = 5;
var y = 2;
var sum = x + y; //7
var sub = x - y; //3
var mul = x * y; //10
var div = x / y; //2.5
var rem = x % y; //1
//var increment = x ++ y;
//var decrement = x -- y;
var expo = x ** y; // 25 exponentation 거듭제곱
var bin = x ^ y; //7 2진수 xor
var a = x += y; // 7 | same as x = (x + y)
var b = x -= y; // 3 | x = (x - y)
var c = x *= y; // 10 | x = (x * y)
var d = x /= y; // 2.5 | x = (x / y)
var e = x &= y; // 1 } x = (x % y)
document.getElementById("demo").innerHTML = sum;
document.getElementById("demo").innerHTML = sub;
document.getElementById("demo").innerHTML = mul;
document.getElementById("demo").innerHTML = div;
document.getElementById("demo").innerHTML = rem;
document.getElementById("demo").innerHTML = expo;
//Variables
var length = 16; //Number
var carName = "Volvo"; //String
//carName = variable
//Volve = vaulue
var a = 16 + "Volvo"; -> not number and string
= var a = "16" + "Volvo"; -> JavaScript will treat the number as a string
var x = 16 + 4 + "Volvo";
Result : 20Volvo
var y = "Volvo" + 16 + 4
Result : Volvo164
var x = {
firstName : "John", // Object
lastName : "Doe"
};
</script>
</body>
</html>
JavaScript Comparision Operators
== equal to
=== equal value and equal type
!= not equal
!= not equal value or not equal type
> greater than
< less than
>= greater than or equal to
<= less than or equal to
? ternary operator
JavaScript Comparision Operators
== equal to
=== equal value and equal type
!= not equal
!= not equal value or not equal type
> greater than
< less than
>= greater than or equal to
<= less than or equal to
? ternary operator
* JAVA - method
Java script - fuction
기능임
* Loop 반복문
While
=============================================================
반응형
'블록체인 기반 핀테크 및 응용 SW개발자 양성과정 일기' 카테고리의 다른 글
6일차 공부한 내용 정리 및 복습 -JS 조건문, 반복문, 변수, boolean, 색변경 등등 (0) | 2021.03.22 |
---|---|
[7일차]20210322 JavaScript 기초 / 조건문/반복문/제어문/등등.. (0) | 2021.03.22 |
[6일차]20210319 프로그래머스 웹사이트 레이아웃 (0) | 2021.03.19 |
[5일차]20210318 Position:absolute; Postition:relative; Position:fixed (0) | 2021.03.18 |
[4일차] 20210317 웹사이트 화면만 html 로 60% 만들기 (4) | 2021.03.17 |