mozilla

Revision 651767 of New in JavaScript 1.2

  • リビジョンの URL スラグ: Web/JavaScript/New_in_JavaScript/1.2
  • リビジョンのタイトル: New in JavaScript 1.2
  • リビジョンの ID: 651767
  • 作成日:
  • 作成者: fscholz
  • 現行リビジョン いいえ
  • コメント History digging. Add new and changed features of JavaScript 1.2
タグ: 

このリビジョンの内容

The following is a changelog for JavaScript from Netscape Navigator 3.0 to 4.0. The old Netscape documentation can be found on archive.org. Netscape Navigator 4.0 was released on June 11, 1997. Netscape Navigator 4.0 was the third major version of the browser with JavaScript support.

JavaScript versions

Netscape Navigator 4.0 executes JavaScript language versions up to 1.2. Note that Netscape Navigator 3.0 and earlier ignored scripts with the language attribute set to "JavaScript1.2" and higher.

<SCRIPT LANGUAGE="JavaScript1.1"> <!-- JavaScript for Navigator 3.0. -->
<SCRIPT LANGUAGE="JavaScript1.2"> <!-- JavaScript for Navigator 4.0. -->

New features in JavaScript 1.2

New objects

  • You can create objects using literal notation.
  • arguments
  • Arrays can now be created using literal notation.

New properties

New methods

New operators

New statements

Other new features

Changed functionality in JavaScript 1.2

  • You can now nest functions within functions.
  • Functions can now be created with a function constructor.
  • Number now converts a specified object to a number.
  • Number now produces NaN rather than an error if x is a string that does not contain a well-formed numeric literal.
  • String now converts a specified object to a string.
  • Array.prototype.sort() now works on all platforms. It no longer converts undefined elements to null and sorts them to the high end of the array.
  • String.prototype.split()
    • It can take a regular expression argument, as well as a fixed string, by which to split the object string.
    • It can take a limit count so that it won't include trailing empty elements in the resulting array.
  • String.prototype.substring(): no longer swaps index numbers when the first index is greater than the second.
  • toString(): now converts the object or array to a literal.
  • The break and continue statements can now be used with the new labeled statement.

このリビジョンのソースコード

<div>
 <section class="Quick_links" id="Quick_Links">
  {{ListSubpages("/en-US/docs/Web/JavaScript/New_in_JavaScript", "2", "0", "1")}}</section>
 <div>
  <p>The following is a changelog for JavaScript from Netscape Navigator 3.0 to 4.0. The old Netscape documentation can be found on <a href="http://web.archive.org/web/19971015223714/http://developer.netscape.com/library/documentation/communicator/jsguide/js1_2.htm">archive.org</a>. Netscape Navigator 4.0 was released on June 11, 1997. Netscape Navigator 4.0 was the third major version of the browser with JavaScript support.</p>
  <h2 id="JavaScript_versions">JavaScript versions</h2>
  <p>Netscape Navigator 4.0 executes JavaScript language versions up to 1.2. Note that Netscape Navigator 3.0 and earlier ignored scripts with the language attribute set to "JavaScript1.2" and higher.</p>
  <pre class="brush: html">
&lt;SCRIPT LANGUAGE="JavaScript1.1"&gt; &lt;!-- JavaScript for Navigator 3.0. --&gt;
&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt; &lt;!-- JavaScript for Navigator 4.0. --&gt;</pre>
  <h2 id="New_features_in_JavaScript_1.1">New features in JavaScript 1.2</h2>
  <h3 id="New_objects">New objects</h3>
  <ul>
   <li>You can create objects using literal notation.</li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments">arguments</a></li>
   <li>Arrays can now be created using literal notation.</li>
  </ul>
  <h3 id="New_properties">New properties</h3>
  <ul>
   <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/arity">Function.arity()</a></code></li>
  </ul>
  <h3 id="New_methods">New methods</h3>
  <ul>
   <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat">Array.prototype.concat()</a></code></li>
   <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice">Array.prototype.slice()</a></code></li>
   <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt">String.prototype.charCodeat()</a></code></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat"><code>String.prototype.concat()</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode"><code>String.fromCharCode()</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match"><code>String.prototype.match()</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace"><code>String.prototype.replace()</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search"><code>String.prototype.search()</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice"><code>String.prototype.slice()</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr"><code>String.prototype.substr()</code></a></li>
  </ul>
  <h3>New operators</h3>
  <ul>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/delete"><code>delete</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Equality_comparisons_and_when_to_use_them">Equality operators</a> (<code>==</code> and <code>!=</code>)</li>
  </ul>
  <h3>New statements</h3>
  <ul>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Statements/label">Labeled</a> statements</li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Statements/switch"><code>switch</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Statements/do...while"><code>do...while</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Statements/import"><code>import</code></a></li>
   <li><a href="/en-US/docs/Web/JavaScript/Reference/Statements/export"><code>export</code></a></li>
  </ul>
  <h3 id="Other_new_features">Other new features</h3>
  <ul>
   <li><a href="/en-US/docs/Web/JavaScript/Guide/Regular_Expressions">Regular Expressions</a></li>
   <li><a href="http://web.archive.org/web/19971015223714/http://developer.netscape.com/library/documentation/communicator/jsguide/js1_2.htm">Signed scripts</a></li>
  </ul>
  <h2 id="Changed_functionality_in_JavaScript_1.1">Changed functionality in JavaScript 1.2</h2>
 </div>
</div>
<ul>
 <li>You can now nest functions within functions.</li>
 <li>Functions can now be created with a function constructor.</li>
 <li>Number now converts a specified object to a number.</li>
 <li>Number now produces <code>NaN</code> rather than an error if <code>x</code> is a string that does not contain a well-formed numeric literal.</li>
 <li>String now converts a specified object to a string.</li>
 <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort">Array.prototype.sort()</a></code> now works on all platforms. It no longer converts undefined elements to null and sorts them to the high end of the array.</li>
 <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split">String.prototype.split()</a></code>
  <ul>
   <li>It can take a regular expression argument, as well as a fixed string, by which to split the object string.</li>
   <li>It can take a limit count so that it won't include trailing empty elements in the resulting array.</li>
  </ul>
 </li>
 <li><code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring">String.prototype.substring()</a></code>: no longer swaps index numbers when the first index is greater than the second.</li>
 <li><code>toString()</code>: now converts the object or array to a literal.</li>
 <li>The <a href="/en-US/docs/Web/JavaScript/Reference/Statements/break"><code>break</code></a> and <a href="/en-US/docs/Web/JavaScript/Reference/Statements/continue"><code>continue</code></a> statements can now be used with the new labeled statement.</li>
</ul>
このリビジョンへ戻す