多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
| JScript  | [逄晟統蕉](#) | |-----|-----| # JScript 腔杅擂濬倰 Jscript 衄笱翋猁杅擂濬倰﹜謗笱葩磁杅擂濬倰睿謗笱杻忷杅擂濬倰﹝ 翋猁ㄗ價掛ㄘ杅擂濬倰岆ㄩ - 趼睫揹 - 杅硉 - 票嫌 葩磁ㄗ竘蚚ㄘ杅擂濬倰岆ㄩ - 勤砓 - 杅郪 杻忷杅擂濬倰岆ㄩ - Null - Undefined ### 趼睫揹杅擂濬倰 珨跺趼睫揹硉岆齬婓珨腔珨揹錨麼錨眕奻腔 Unicode 趼睫ㄗ趼譫﹜杅趼睿梓萸睫瘍ㄘ﹝趼睫揹杅擂濬倰蚚懂桶尨 JScript 笢腔恅掛﹝褐掛笢褫眕婦漪趼睫揹恅趼ㄛ涴虳趼睫揹恅趼溫婓珨勤饜腔腔等竘瘍麼邧竘瘍笢﹝趼睫揹笢褫眕婦漪邧竘瘍ㄛ蜆邧竘瘍謗晚剒樓等竘瘍ㄛ珩褫眕婦漪等竘瘍ㄛ蜆等竘瘍謗晚剒樓邧竘瘍﹝狟醱岆趼睫揹腔尨瞰ㄩ ~~~ "Happy am I; from care I*m free!" '"Avast, ye lubbers!" roared the technician.' "42" 'c' ~~~ 蛁砩ㄛJScript 笢羶衄桶尨等跺趼睫腔濬倰ㄗ C++ 腔 **char**ㄘ﹝猁桶尨 Jscript 笢腔等跺趼睫ㄛ茼斐膘珨跺硐婦漪珨跺趼睫腔趼睫揹﹝婦漪錨跺趼睫ㄗ""ㄘ腔趼睫揹岆諾ㄗ錨酗僅ㄘ趼睫揹﹝ ### 杅硉杅擂濬倰 婓 Jscript 笢淕杅睿腹萸硉羶衄船梗˙JScript 杅硉褫眕岆笢砩珨笱ㄗJScript 囀窒蔚垀衄腔杅硉桶尨峈腹萸硉ㄘ﹝ ### 淕倰硉 淕倰硉褫眕岆淏淕杅ㄛ蛹淕杅睿 0﹝褫眕蚚 10 輛秶ㄛ8 輛秶睿 16 輛秶懂桶尨﹝婓 Jscript 笢湮嗣杅趼岆蚚坋輛秶桶尨腔﹝樓袟※0§桶尨 8 輛秶腔淕倰硉ㄛ硐夔婦漪 0 善 7 腔杅趼﹝袟峈※0§肮奀婦漪杅趼※8§麼※9§腔杅掩賤庋峈坋輛秶杅﹝ 樓袟※0x§ㄗ錨睿x|Xㄘ桶尨 16 輛秶淕倰硉﹝褫眕婦漪杅趼 0 善 9ㄛ眕摯趼譫 A 善 Fㄗ湮迡麼苤迡ㄘ﹝妏蚚趼譫 A 善 F 桶尨坋輛秶 10 善 15 腔等跺杅趼﹝憩岆佽 0xF 迵 15 眈脹ㄛ肮奀 0x10 脹衾 16﹝ 匐輛秶睿坋鞠輛秶杅褫眕峈蛹ㄛ筍祥夔衄苤杅弇ㄛ肮奀祥夔眕褪悝數杅楊ㄗ硌杅ㄘ桶尨﹝ ### 腹萸硉 腹萸硉峈湍苤杅窒煦腔杅﹝珩褫眕蚚褪悝數杅楊懂桶尨﹝涴憩岆佽ㄛ湮迡麼苤迡※e§蚚懂桶尨 10 腔棒源﹝Jscript蚚杅硉桶尨腔匐趼誹 IEEE754 腹萸梓袧﹝涴砩庤覂杅趼郔湮褫眕善㊣1.7976931348623157x10308ㄛ郔苤善㊣5x10-324﹝眕※0§羲宎婦漪苤杅萸腔杅趼掩賤庋峈苤杅腹萸杅﹝ 蛁砩眕※0x§麼※00§羲宎甜婦漪苤杅萸腔杅蔚楷汜渣昫﹝眕狟岆 Jscript 笢杅趼腔瞰赽﹝ | 杅趼 | 鏡扴 | 脹歎坋輛秶杅 | |-----|-----|-----| | .0001, 0.0001, 1e-4, 1.0e-4 | 侐跺眈脹腔腹萸杅﹝ | 0.0001 | | 3.45e2 | 腹萸杅﹝ | 345 | | 42 | 淕杅﹝ | 42 | | 0378 | 淕杅﹝呥艘懂岆匐輛秶杅ㄗ眕0羲芛ㄘㄛ筍岆8祥岆衄虴腔匐輛秶杅趼ㄛ垀眕峈坋輛秶杅﹝ | 378 | | 0377 | 匐輛秶淕杅﹝蛁砩坳呥艘懂掀奻醱腔杅硐苤1ㄛ筍妗暱杅硉衄竭湮祥肮﹝ | 255 | | 0.0001 | 腹萸杅﹝呥眕錨羲芛ㄛ筍蚕衾湍衄苤杅萸垀眕祥岆匐輛秶杅﹝ | 0.0001 | | 00.0001 | 渣昫﹝謗跺錨羲芛桶尨峈匐輛秶ㄛ筍匐輛秶杅祥夔湍衄苤杅窒煦﹝ | N/A ㄗ晤祒渣昫ㄘ | | 0Xff | 坋鞠輛秶淕杅﹝ | 255 | | 0x37CF | 坋鞠輛秶淕杅﹝ | 14287 | | 0x3e7 | 坋鞠輛秶淕杅﹝蛁砩&e*甜祥掩峈硌杅﹝ | 999 | | 0x3.45e2 | 渣昫﹝坋鞠輛秶杅祥夔衄苤杅窒煦﹝ | N/A ㄗ晤祒渣昫ㄘ | 鍚俋ㄛJScript婦漪杻忷硉杅趼﹝坳蠅岆ㄩ - NaN ㄗ祥岆杅ㄘ﹝絞勤祥巠絞腔杅擂輛俴杅悝堍呾奀妏蚚ㄛ瞰趼睫揹麼帤隅砱硉﹝ - 淏拸湮﹝婓JScript笢彆珨跺淏杅怮湮腔趕妏蚚坳懂桶尨﹝ - 蛹拸湮﹝婓JScript笢彆珨跺蛹杅怮湮腔趕妏蚚坳懂桶尨﹝ - 淏0睿蛹0﹝Jscript煦淏0睿蛹0﹝ ### Boolean杅擂濬倰 鴃奪趼睫揹睿杅趼濬倰褫眕衄拸杅祥肮腔硉ㄛboolean 杅擂濬倰硐衄謗跺硉﹝坳蠅岆恅趼 **true **睿 **false**﹝Boolean硉岆珨跺淩硉ㄛ坳桶尨珨跺袨怓腔衄虴俶ㄗ佽隴蜆袨怓峈淩麼樑ㄘ﹝ 褐掛笢腔掀誕籵都腕善珨跺 Boolean 賦彆﹝蕉藉狟珨俴 Jscript 測鎢﹝ ~~~ y = (x == 2000); ~~~ 涴爵猁掀誕曹講 x 腔硉岆瘁迵杅趼 2000 眈脹﹝彆眈脹ㄛ掀誕腔賦彆峈 Boolean 硉 **true**ㄛ甜蔚董跤曹講 y﹝彆x迵2000祥脹ㄛ寀掀誕腔賦彆峈boolean硉**false**﹝ Boolean硉婓賦凳諷秶笢蚧衄蚚﹝褫眕蔚眻諉斐膘 boolean 硉腔掀誕迵蚚妏蚚蜆 boolean 硉腔逄曆眈郪磁﹝蕉藉狟醱腔JScript測鎢毓瞰﹝ ~~~ if (x == 2000) z = z + 1; else x = x + 1; ~~~ 絞 boolean 硉峈 **true** 奀ㄛJscript 笢腔 **if/else** 逄曆硒俴珨跺紱釬ㄗ涴欴ㄛz = z + 1ㄘㄛ奧絞 boolean 硉峈 **false** 奀硒俴鍚珨跺紱釬ㄗx = x + 1ㄘ﹝ 褫眕妏蚚砩桶湛宒釬掀誕桶湛宒﹝睡硉峈0﹜null﹜帤隅砱麼諾趼睫揹腔桶湛宒掩賤庋峈 **false**﹝坻砩硉腔桶湛宒賤庋峈 **true**﹝瞰ㄛ褫眕妏蚚狟桶湛宒ㄩ ~~~ if (x = y + z) // ~~~ 涴褫夔祥岆砑猁腔賦彆 ~~~ 每 ~~~ 狟ㄐ 蛁砩奻醱腔測鎢甜祥潰脤 x 岆瘁迵 y+z 眈脹ㄛ秪峈躺妏蚚賸珨跺脹瘍ㄗ董硉ㄘ﹝眈毀腔ㄛ奻醱腔測鎢蔚 y+z 董跤曹講 xㄛ綴潰脤淕跺桶湛宒腔硉岆瘁峈錨﹝猁潰脤 x 岆瘁迵 y+z 眈脹ㄛ妏蚚狟測鎢﹝ ~~~ if (x == y + z) // ~~~ 涴迵奻醱腔測鎢祥肮ㄐ 衄壽掀誕腔砆牉陓洘ㄛ統獗[諷秶最唗腔霜最](#)﹝ ### Null 杅擂濬倰 婓 Jscript 笢杅擂濬倰 **null** 硐衄珨跺硉ㄩnull﹝壽瑩趼 null 祥夔蚚釬滲杅麼曹講腔靡備﹝ 婦漪 null 腔曹講婦漪※拸硉§麼※拸勤砓§﹝遙曆趕佽ㄛ蜆曹講羶衄悵湔衄虴腔杅﹜趼睫揹﹜boolean﹜杅郪麼勤砓﹝褫眕籵徹跤珨跺曹講董 null 硉懂壺曹講腔囀﹝ 蛁砩ㄛ婓 Jscript 笢ㄛnull 迵 0 祥眈脹ㄗ迵婓 C 睿 C++ 笢祥肮ㄘ﹝肮奀茼蜆硌堤腔岆ㄛJscript笢 **typeof** 堍呾睫蔚惆豢 null 硉峈 **Object** 濬倰ㄛ奧準濬倰 null﹝涴萸婓腔髦秎岆峈賸砃狟潭﹝ ### Undefined 杅擂濬倰 狟錶妏殿隙 undefined 硉ㄩ - 勤砓扽俶祥湔婓ㄛ - 汒隴賸曹講筍植帤董硉﹝ 蛁砩祥夔籵徹迵 undefined 酕掀誕懂聆彸珨跺曹講岆瘁湔婓ㄛ呥褫眕潰脤坳腔濬倰岆瘁峈※undefined§﹝婓眕狟腔測鎢毓瞰笢ㄛ樑扢最唗埜砑聆彸岆瘁眒冪汒隴曹講 x ㄩ ~~~ // ~~~ 涴笱源楊祥釬蚚 ~~~ if (x == undefined) ~~~ ~~~ // ~~~ 釬議虳紱釬 ~~~ // ~~~ 涴跺源楊肮欴祥釬蚚 ~~~ - ~~~ 斛剕潰脤 ~~~ // ~~~ 趼睫揹 ~~~ "undefined" ~~~ ~~~ if (typeof(x) == undefined) ~~~ ~~~ // ~~~ 釬議虳紱釬 ~~~ // ~~~ 涴跺源楊衄虴 ~~~ if (typeof(x) == "undefined") ~~~ ~~~ // ~~~ 釬議虳紱釬 蕉藉蔚 undefined 硉迵null酕掀誕﹝ ~~~ someObject.prop == null; ~~~ 狟錶奀ㄛ掀誕腔賦彆峈 **true**ㄛ - 彆扽俶 someObject.prop 婦漪 null 硉ㄛ - 彆扽俶 someObject.prop 祥湔婓﹝ - 猁潰脤珨跺勤砓扽俶岆瘁湔婓ㄛ褫眕妏蚚陔腔 **in** 堍呾睫ㄩ ~~~ if ("prop" in someObject) // someObject ~~~ 衄扽俶 ~~~ 'prop' ~~~ [© 2000 Microsoft Corporation 唳垀衄﹝悵隱垀衄瞳﹝妏蚚寞隅﹝](#)