Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 726439 of New in JavaScript 1.2

  • Revision slug: Web/JavaScript/New_in_JavaScript/1.2
  • Revision title: New in JavaScript 1.2
  • Revision id: 726439
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

{{jsSidebar("New_in_JS")}}

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 (inspired by dictionary literal syntax from Python 1.x).
  • Arrays can now be created using literal notation (inspired by list literal syntax from Python 1.x).
  • arguments

New properties

New methods

New operators

New statements

Other new features

Changed functionality in JavaScript 1.2

  • You can now nest functions within functions.
  • 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.

Revision Source

<div>{{jsSidebar("New_in_JS")}}</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="https://web.archive.org/web/19971015223714/https://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.2">New features in JavaScript 1.2</h2>

<h3 id="New_objects">New objects</h3>

<ul>
 <li>You can create objects using literal notation (inspired by dictionary literal syntax from Python 1.x).</li>
 <li>Arrays can now be created using literal notation (inspired by list literal syntax from Python 1.x).</li>
 <li><a href="/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope/arguments">arguments</a></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 id="New_operators">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 id="New_statements">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="https://web.archive.org/web/19971015223714/https://developer.netscape.com/library/documentation/communicator/jsguide/js1_2.htm">Signed scripts</a></li>
</ul>

<h2 id="Changed_functionality_in_JavaScript_1.2">Changed functionality in JavaScript 1.2</h2>

<ul>
 <li>You can now nest functions within functions.</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>
Revert to this revision