Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> JavaScript

เครื่องหมายจุลภาคทำอะไรในนิพจน์ JavaScript?


จุลภาคเป็นออปเกรเตอร์ใน JavaScript ซึ่งคืนค่า operand ตัวสุดท้ายขณะประเมิน operand ทุกตัว

ตัวอย่าง

<!DOCTYPE html> <html>    <body>       <script>          var a = 100;          a = (a++, a);          document.write(a);          a = (200, 300);          document.write("<br>"+a);       </script>    </body> </html>