คำสงวนของภาษา JavaScript
สำหรับการตั้งชื่อตัวแปรในภาษา Java Script นั้น คุณสามารถตั้งชื่อตัวแปรได้โดยใช้ ตัวอักษรในภาษาอังกฤษ A-Z ทั้งตัวพิมพ์ใหญ่
และตัวพิมพ์เล็ก ตัวเลข 0 - 9 โดยที่คุณไม่สามารถใช้ตัวอักษรพิเศษอื่นๆได้ ยกเว้นเครื่องหมาย _ (Under Scroll) และ $
เท่านั้นที่สามารถใช้งานได้
คำสงวน
นอกเหนือจากนี้ยังมีคำสงวนอีก 53 คำ ที่ไม่สามารถนำเอามาตั้งเป็นชื่อตัวแปร, ฟังก์ชั่น, เมธอด ต่างๆได้ เพราะว่าเป็นคำสั่งของภาษา
Java Script ที่ใช้ในการทำงานอยู่แล้ว ซึ่งมีดังนี้
abstract |
float |
public |
boolean |
for |
return |
break |
function |
short |
byte |
goto |
static |
case |
if |
super |
catch |
imperments |
switch |
char |
import |
synchronized |
class |
in |
this |
const |
instanceof |
throw |
continue |
int |
throws |
default |
interface |
ransient |
do |
long |
true |
double |
native |
try |
else |
new |
var |
extends |
null |
void |
false |
package |
while |
final |
private |
with |
finally |
protected |
|
|