ข้อควรจำของภาษาจาวาสคริป์ (javascript)
1. javascript เป็นภาษา Case-sensitive คือ ชื่อเดียวกัน แต่ตัวเล็กตัวใหญ่ไม่เหมือน ก็จะถือว่าเป็นตัวแปรคนละตัว
2. ใช้ภาษา Unicode
3. statement คือ โค้ดภาษาจาวา โดยใช้ ; ( semi-colon ) เป็นอักขระในการจบ statement
4. white space คือ การกด space bar , กด tabs และการขึ้นบรรทัดใหม่
5. comment 1 บรรทัดใช้ //
6. comment หลายบรรทัดใช้ /*.......*/
7. การประะกาศตัวแปร : var , let , const
8. ตัวอักขระพิเศษที่สามารถใช้เป็นชื่อตัวแปรได้ : underscore ( _ ), dollar sign ( $ ) , 0-9 , A-Z , a-z
9. undefined คือตัวแปรที่สร้างขึ้น แต่ไม่มีค่า หรือไม่ถูก assign ค่าให้
10. null คือ 0 หรือ false
11 const การประกาศตัวแปรที่ไม่สามารถเปลี่ยนแปลงค่าได้
12 variable type : boolean , null , undefined , number , string , symbol . , Ojbect
13 ประเภทข้อมูลที่จาวาสคริปต์รับได้ : Array , Boolean , Floating-point , integers Object , RegExp , String
14 ตัวอักษรพิเศษที่ใช้บ่อย :
\b = backspce
\n = new line
No comments:
Post a Comment