{"id":266,"date":"2007-08-18T22:30:41","date_gmt":"2007-08-18T20:30:41","guid":{"rendered":"http:\/\/blog.marudina.net\/?p=266"},"modified":"2007-08-18T22:32:57","modified_gmt":"2007-08-18T20:32:57","slug":"javascript-%d0%b4%d1%80%d0%b5%d0%b1%d0%be%d0%bb%d0%b8%d0%b8","status":"publish","type":"post","link":"https:\/\/blog.marudina.net\/?p=266","title":{"rendered":"JavaScript ????????"},"content":{"rendered":"<p>??? ?????? ?? ?????????????? ?? <a href=\"http:\/\/www.ecma-international.org\/publications\/files\/ECMA-ST\/Ecma-262.pdf\">ECMAScript 2.0<\/a> ? ?? ??????? <a href=\"http:\/\/www.oreilly.com\/catalog\/jscript5\/\">&#8220;JavaScript: The Definitive Guide \/5th edition\/&#8221;<\/a> ?? O&#8217;Reilly ???????? ?? ????? ??????? ???????? :<\/p>\n<ul>\n<li>??????? ??, ?? ??? ??????? ????? ???????? ??? ??????? ????<br \/>\n<code>function myFunc() {<br \/>\n\treturn 5;<br \/>\n}<br \/>\nalert(myFunc());<\/code><br \/>\n<code>function myFunc() {<br \/>\n\treturn<br \/>\n\t5;<br \/>\n}<br \/>\nalert(myFunc());<\/code><br \/>\n????????? ?? ????? ?? ?????? &#8220;??!&#8221; ?? ????????. ????? ??, ?? ?????? ?????????????? JavaScript, ???????? ???? ?? ???????????? ??????? ? ??? ????????????? ???????????, ? ??? ????????, ?? ?????? ?? &#8220;?????&#8221; ?????? ???????????. ? ?? ????? &#8216;;&#8217; ???, ?????? ???????, ?? ??????. ?, ??? ????? return\/throw ? ????????? ?? ?????, ??? ????? break\/continue ? ???????, ??? ????? ?????????? ? ?????????????\/????????????? ????? ??? ???, ?? JavaScript ?????? ????? ? ??????? ????? ????? ???. ???? ?? ?????? ???? ?????? ?? ???? ??? ??? ?? ?????? ???? ????? ?? ?? ?????? ????? ?? ? ????? ? ????? ????????? ????? ?? ???.\n<\/li>\n<li>? ?????????? ?? ???? Number ??????? ??????? ?????:<br \/>\n<blockquote><p>Note that these two infinite number values are produced by the program expressions +Infinity (or simply Infinity) and<br \/>\n-Infinity, assuming that the globally defined variable Infinity has not been altered by program<br \/>\nexecution.<\/p><\/blockquote>\n<p>???? ????????? ? ??? ??????? ????:<\/p>\n<p><code>alert(5 == +Infinity); \/\/ ???????? : false<br \/>\nInfinity=5;<br \/>\nalert(5 == +Infinity); \/\/ ???????? : true<\/code><\/p>\n<\/li>\n<li>???????? === : ???????? ?? ???? ???????????, ?? ? <strong>????????<\/strong>; ???????? :<br \/>\n<code>var a = 5;<br \/>\nalert(a == \"5\"); \/\/ ?????<br \/>\nalert(a === \"5\") \/\/ ???? - ???????? ??????;<\/code><\/li>\n<li>?????? ?? ?? ??????? ?????? ?????? ?? ???????? ???? ???? ?????????? ? ??????? ?????????? ?? <strong>null<\/strong> ? ???? ?????? ?? ? ??????????????, ?.?. ??? ???????? <strong>undefined<\/strong>. ???????? ????????? :<br \/>\n<code>unknownVar == null;<\/code><br \/>\n?????? unknownVar ? ??????? ??????????, ????????? ?? ????? ???, ????? ??????! ?? ???? ??? ?????? ?? ??? ???????, ?? ?????????? ? ???????? undefined, ? ?? null, ?????? ?? ?????????? ???????????? ? null ???? ????????===:<br \/>\n<code>unknownVar === null;<\/code>\n<\/li>\n<li>???????? ???????? ??? (||) ?????? ????? ?????? ?? ????? ???????? ? C\/C++\/Java &#8211; ??? ?????? ??????? ? true ??? ???? ?? ?? ?????????? ?? ???? ????????, ?? ?????? ?? ?? ????????? ?????, ?????? ???? ??? ????? ??????????? ??????? ? ????????????? (???? ?? ??????????? ? true). ?? ??? ???? ????. ???? ?? ?? ??????, ?? JavaScript ?? ????????? ?? ???????? ?? ????????? ??? ?????? ???????? &#8211; true ??? false, ? ?????????? ?? ????? ???????! ?.?. ???????? ?? ?????? ? ?????? ?? ????? ???????? (?? ???? ?? ?????), ????? ?? ???? ?? ?? ??????????? ?? false &#8211; ?? ? undefined, ?? ? null ? ?.?. ???? ?? ???? ?? ?? ???????? ?? ??????? ????? :<br \/>\n<code>var width = minWidth || averageWidth || 50;<\/code><br \/>\n??? ????? ?? ??????? ????????? ?? ? ????????, ?? ?? width ?? ?? ??????? ???????? 50;<\/li>\n<li>????? ?? ??????? ?????????? N ???????? ?? ????? ?? ??????? ?????:<br \/>\n<code>var a = [1, 2, 3, 4, 5, 6];<br \/>\nvar n = 2;<br \/>\na.length = a.length - n;<br \/>\nalert(a.join(\", \"));<\/code><\/li>\n<li>????????? Array.slice() ????? ????????, ?????????? ?? ????????? ????? ?????? ?? ?????? ??????. ????? ????? ????? ??? ??????? ??????????? ????? ???? ???????<br \/>\n<code>var a = [1, 2, 3, 4, 5, 6];<br \/>\nvar n = 2;<br \/>\nvar b = a.slice(1, -1);<br \/>\nalert(b.join(\", \"));<\/code><br \/>\n????? ????????, ???????? ?? ???????? ? ?????? 1 (?.?. ?????? ???????), ???? ????? ??? ?? ??????? ?? ????????? ???????.<\/li>\n<li>??? ?????? ?? ?????????? ???????? ??????? type=&#8221;text\/javascript&#8221; ? HTML ?????????, ?? ???????? ???????? ? head ????????:<br \/>\n<code>&lt;meta http-equiv=\"Content-Script-Type\" content=\"text\/javascript\"&gt;&lt;\/meta&gt;<\/code><br \/>\n???? ???? ? ?? ??????? ????? ??????? ?? ? ?????? ???? ?? ???????????? ?? ??????????? ? ?????????.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>??? ?????? ?? ?????????????? ?? ECMAScript 2.0 ? ?? ??????? &#8220;JavaScript: The Definitive Guide \/5th edition\/&#8221; ?? O&#8217;Reilly ???????? ?? ????? ??????? ???????? : ??????? ??, ?? ??? ??????? ????? ???????? ??? ??????? ???? function myFunc() { return 5; } alert(myFunc()); function myFunc() { return 5; } alert(myFunc()); ????????? ?? ????? ?? ?????? &#8220;??!&#8221; ?? [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.marudina.net\/index.php?rest_route=\/wp\/v2\/posts\/266"}],"collection":[{"href":"https:\/\/blog.marudina.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.marudina.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.marudina.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.marudina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=266"}],"version-history":[{"count":0,"href":"https:\/\/blog.marudina.net\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.marudina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.marudina.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.marudina.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}