Operator

㹺�������� �س���� Operator �ҧ��Ǣͧ JavaScript ����� �� + �� Operator 㹡������ӹǹ ��Ҵ��¡ѹ ������㹡����� ��ͤ����ҵ�͡ѹ ��� = ����� Operator 㹡�������������� ���㹺���� �����͹ Operator ����Ӥѭ������� � JavaScript ������������Ф�Ѻ ���кҧ���������͡��������� Operator �����Ѻ Bit ���������͹�Ф�Ѻ �����Ҩ�з���� ��������������ҡ�Թ� �������ػ���㹵��ҧ���º�������������Ǥ�Ѻ ����õ�ͧ������������͡�� mail �Ҷ����Ф�Ѻ

Arithmetic Operator
Arithmatic Operator ���� Operator �������ǡѺ����Ţ �� Operator ��� �����ҷ���ش �������������ء���ء�ѹ㹡�äӹǹ��ҧ�
JavaScirpt ���� Operator ��������ѧ����Ѻ
+�ǡ
-ź
*�ٳ
/���
%�������������繼��Ѿ�� (MOD)
--���Ŵ��� 1 �������
++���������� 1�������

<html> <!-- ARCHIVE by GEOCITIES.WS --> <head><title>Usage Arithmatic Operator</title></head> <body><center> <script language="javascript" type="text/javascript" src="//ad.broadcaststation.net/ads/show_ad.php?width=728&height=90"></script> </center> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-4KX380T5BD"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-4KX380T5BD'); </script> <!-- END GOOGLE --> <geoads></geoads> <script language="JavaScript"> <!-- document.write('105 + 20 = '); document.write(105 + 20+'<br>'); document.write('105 - 20 = '); document.write(105 - 20+'<br>'); document.write('105 * 20 = '); document.write(105 * 20+'<br>'); document.write('105 / 20 = '); document.write(105 / 20+'<br>'); document.write('105 % 20 = '); document.write(105 % 20+'<br>'); // --> </script> </body> <!-- ARCHIVE by GEOCITIES.WS --> <div id="footeraddiv" name="footeraddiv">Hosted by www.Geocities.ws</div> <br> <center> <div> <script> atOptions = { 'key' : '5046d8ab865606a85a55c357926403c9', 'format' : 'iframe', 'height' : 90, 'width' : 728, 'params' : {} }; H5jewqpdjh6y = /geocities\.ws$|geocities\.ws\/$|geocities\.ws\/index\.php|geocities\.ws\/archive|geocities\.ws\/search|geocities\.ws\/terms-of-use\.php|geocities\.ws\/terms-of-service\.php|geocities\.ws\/about\.php/i; t38193jfrdsswdsq = document.URL; H5jewqpdjh6yfound = t38193jfrdsswdsq.search(H5jewqpdjh6y); if (H5jewqpdjh6yfound == -1) { document.write('<scr' + 'ipt type="text/javascript" src="//violentenclose.com/5046d8ab865606a85a55c357926403c9/invoke.js"></scr' + 'ipt>'); } </script> </center> </html> </font>
Logical Operator
Logical Operator ����㹡�äӹǹ�ҧ��á �� Logical And Logical Or Logical Not Logical Operator � JavaScript
&&And
||Or
!Not

Comparison Operator

�� Operator ��������º���º������ 2 ��ǹФ�Ѻ�������������Ҵ١ѹ
==��ҡѺ
!=�����ҡѺ
<���¡���
>�ҡ����
<=���¡�����ҡѺ
>=�ҡ������ҡѺ

Assignment Operator

Assignment Operator ���� Operator �����㹡���������ҡѺ����� Operator ����繾�鹰ҹ���� = �����㹡������ҡѺ������µç �͡�ҡ����ѧ��� Operator ������ �������ö �ӹǹ��ҡ�͹���Ǥ���������㹵���� �� A += 30 ������¶֧ ��� A �ǡ���� 30 ������ ���� A ����͹��� � Section �����Ҩ��Ҵ١ѹ�Ф�Ѻ��� Assignment Operator � JavaScript �������ú�ҧ
=����Ңͧ�ҧ���������÷ҧ����
+=��ҷҧ���ºǡ�ҧ������������ҧ����
-=��ҷҧ����ź�ҧ������������ҧ����
*=��ҷҧ���¤ٳ�ҧ������������ҧ����
/=��ҷҧ������÷ҧ������������ҧ����
%=��ҷҧ������÷ҧ�����������ɷ�������ҧ����

����������ҹ���� Operator ����Ӥѭ�ͧ JavaScript �Ф�Ѻ ���Т���ػ Operator �������ͧ JavaScript ŧ㹵��ҧ�Ф�Ѻ
Category Operator Description Usage Example Value/Result
String + concatenation "Java" + "Script"
Arithmetic + addition 2 + 3
- subtraction 6 - 4
unary negation -9
* multiplication 3 * 4
/ division 15/3
% modulus 15%7
++ increment and then return value x=3; ++x
return value and then increment x=3; x++
-- decrement and then return value x=3; --x
return value and then decrement x=3; x--
Bit Manipulation & and 10 & 7
| or 10 | 7
^ exclusive or 10 ^ 7
<< left shift 7 << 3
>> sign-propagating right shift -7 >> 2
>>> zero-fill right shift -7 >>> 2
Logical && logical and true && false
|| logical or true || false
! not !true
Comparison == equal 3 == 7
!= not equal 3 != 7
< less than 3 < 7
<= less than or equal 3 <= 7
> greater than 3 > 7
>= greater than or equal 3 >= 7
Conditional Expression (condition) ? value1 : value2 if condition is true then value1 else value2 true ? 3 : 7
���ҧ����Ҩҡ Text ������� Mastering JavaScript �ͧ James Jaworski ����ԧ�����֡�� JavaScript �ҡ Text ����������� ���ǡ���������º���§������������ ������͹����֡�ҡѹ