반응형
https://www.w3schools.com/js/js_operators.asp'
JavaScript Operators
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
www.w3schools.com
이번엔 연산자 이런게 있다라고 보는 시간입니다.
필요할때 찾고 봅시다.
나중에 자세하게 다룬답니다.
OperatorDescription
| + | Addition |
| - | Subtraction |
| * | Multiplication |
| ** | Exponentiation (ES2016) |
| / | Division |
| % | Modulus (Division Remainder) |
| ++ | Increment |
| -- | Decrement |
JavaScript Comparison Operators (비교 연산자)
OperatorDescription
| == | 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 Logical Operators
OperatorDescription
| && | logical and |
| || | logical or |
| ! | logical not |
JavaScript Type Operators
OperatorDescription
| typeof | Returns the type of a variable |
| instanceof | Returns true if an object is an instance of an object type |
JavaScript Bitwise Operators
Bit operators work on 32 bits numbers.
Any numeric operand in the operation is converted into a 32 bit number. The result is converted back to a JavaScript number.
OperatorDescriptionExampleSame asResultDecimal
| & | AND | 5 & 1 | 0101 & 0001 | 0001 | 1 |
| | | OR | 5 | 1 | 0101 | 0001 | 0101 | 5 |
| ~ | NOT | ~ 5 | ~0101 | 1010 | 10 |
| ^ | XOR | 5 ^ 1 | 0101 ^ 0001 | 0100 | 4 |
| << | left shift | 5 << 1 | 0101 << 1 | 1010 | 10 |
| >> | right shift | 5 >> 1 | 0101 >> 1 | 0010 | 2 |
| >>> | unsigned right shift | 5 >>> 1 | 0101 >>> 1 | 0010 | 2 |
728x90
'JavaScript' 카테고리의 다른 글
| 퇴근 후 JS - Arithmetic (산술) (0) | 2023.03.17 |
|---|---|
| 퇴근 후 JS - const (0) | 2023.03.17 |
| 퇴근 후 JS - Variables ( let, const) (0) | 2023.03.17 |
| 퇴근 후 JS - Statements (0) | 2023.03.16 |
| 퇴근 후 JS- 데이터 표현 방법(innerHTML, console.log(), alert()document.write(). (0) | 2023.03.16 |