Khoá học: Thiết lập dự án Wordpress

Nếu bạn đang tìm kiếm một cách nhanh chóng và hiệu quả để thiết lập một trang web cá nhân hoặc doanh nghiệp của mình, hãy bắt đầu với WordPress. Được coi là nền tảng quản lý nội dung (CMS) phổ biến nhất trên thế giới, WordPress cho phép bạn dễ dàng tạo ra một [...]

JavaScript Bài 42: Từ dành riêng (Reserved Words)

– Từ dành riêng là những từ hệ thống, ta không thể sử dụng chúng để đặt tên cho biến, hàm, đối tượng, ….

– Dưới đây là danh sách các từ dành riêng:

abstractargumentsawait*boolean
breakbytecasecatch
charclass*constcontinue
debuggerdefaultdeletedo
doubleelseenum*eval
export*extends*falsefinal
finallyfloatforfunction
gotoifimplementsimport*
ininstanceofintinterface
let*longnativenew
nullpackageprivateprotected
publicreturnshortstatic
super*switchsynchronizedthis
throwthrowstransienttrue
trytypeofvarvoid
volatilewhilewithyield

– Nên tránh sử dụng tên của các đối tượng, thuộc tính, phương thức được xây dựng sẵn:

ArrayDateevalfunction
hasOwnPropertyInfinityisFiniteisNaN
isPrototypeOflengthMathNaN
nameNumberObjectprototype
StringtoStringundefinedvalueOf

– JavaScript có thể được sử dụng như một ngôn ngữ lập trình trong nhiều ứng dụng. Do đó, chúng ta cũng nên tránh sử dụng tên của các đối tượng và thuộc tính của HTML và Window:

alertallanchoranchors
areaassignblurbutton
checkboxclearIntervalclearTimeoutclientInformation
closeclosedconfirmconstructor
cryptodecodeURIdecodeURIComponentdefaultStatus
documentelementelementsembed
embedsencodeURIencodeURIComponentescape
eventfileUploadfocusform
formsframeinnerHeightinnerWidth
layerlayerslinklocation
mimeTypesnavigatenavigatorframes
frameRatehiddenhistoryimage
imagesoffscreenBufferingopenopener
optionouterHeightouterWidthpackages
pageXOffsetpageYOffsetparentparseFloat
parseIntpasswordpkcs11plugin
promptpropertyIsEnumradioreset
screenXscreenYscrollsecure
selectselfsetIntervalsetTimeout
statussubmittainttext
textareatopunescapeuntaint
window

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *