aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/web/javascript/new_in_javascript/1.3/index.html
blob: 635126dc4f940b03b5e6a270f4be28ef131bd8a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
title: New in JavaScript 1.3
slug: Web/JavaScript/New_in_JavaScript/1.3
translation_of: Archive/Web/JavaScript/New_in_JavaScript/1.3
---
<div>{{jsSidebar("New_in_JS")}}</div>

<p>The following is a changelog for JavaScript from Netscape Navigator 4.0 to 4.5. The old Netscape documentation can be found on <a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html">archive.org</a>. Netscape Navigator 4.5 was released on October 19, 1998.</p>

<p>The most significant change in JavaScript 1.3 was compliance with ECMA-262 and Unicode by removing inconsistencies between JavaScript 1.2 and the new ECMA standard (which was published in June 1997). Additional features of version 1.2, at the time not specified by ECMA-262 were kept in the JavaScript language (see below for a list of differences).</p>

<h2 id="JavaScript_versions">JavaScript versions</h2>

<p>Netscape Communicator and Navigator 4.06 and 4.5 executes JavaScript language versions up to 1.3. Note that Communicator and Navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "JavaScript1.3" and higher.</p>

<pre class="brush: html">&lt;SCRIPT LANGUAGE="JavaScript1.2"&gt; &lt;!-- JavaScript for Navigator 4.0. --&gt;
&lt;SCRIPT LANGUAGE="JavaScript1.3"&gt; &lt;!-- JavaScript for Navigator 4.5. --&gt;</pre>

<h2 id="New_features_in_JavaScript_1.3">New features in JavaScript 1.3</h2>

<h3 id="New_globals">New globals</h3>

<ul>
 <li>{{jsxref("NaN")}}</li>
 <li>{{jsxref("Infinity")}}</li>
 <li>{{jsxref("undefined")}}</li>
</ul>

<h3 id="New_methods">New methods</h3>

<ul>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/isFinite"><code>isFinite()</code></a></li>
 <li>{{jsxref("Function.prototype.call()")}}</li>
 <li>{{jsxref("Function.prototype.apply()")}}</li>
 <li>{{jsxref("Date.UTC()")}}</li>
 <li>{{jsxref("Date.prototype.getFullYear()")}}</li>
 <li>{{jsxref("Date.prototype.setFullYear()")}}</li>
 <li>{{jsxref("Date.prototype.getMilliseconds()")}}</li>
 <li>{{jsxref("Date.prototype.setMilliseconds()")}}</li>
 <li>{{jsxref("Date.prototype.getUTCFullYear()")}}</li>
 <li>{{jsxref("Date.prototype.getUTCMonth()")}}</li>
 <li>{{jsxref("Date.prototype.getUTCDate()")}}</li>
 <li>{{jsxref("Date.prototype.getUTCHours()")}}</li>
 <li>{{jsxref("Date.prototype.getUTCMinutes()")}}</li>
 <li>{{jsxref("Date.prototype.getUTCSeconds()")}}</li>
 <li>{{jsxref("Date.prototype.getUTCMilliseconds()")}}</li>
 <li>{{jsxref("Date.prototype.toUTCString()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCFullYear()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCMonth()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCDate()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCHours()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCMinutes()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCSeconds()")}}</li>
 <li>{{jsxref("Date.prototype.setUTCMilliseconds()")}}</li>
</ul>

<h3 id="Other_new_features">Other new features</h3>

<ul>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Using_the_Equality_Operators" title="JavaScript/Reference/Operators/Comparison_Operators#Using_the_Equality_Operators">Strict equality operators</a></li>
 <li>Unicode support</li>
 <li>A JavaScript Console was introduced.</li>
</ul>

<h2 id="Changed_functionality_in_JavaScript_1.3">Changed functionality in JavaScript 1.3</h2>

<ul>
 <li>Changes to <a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Date" title="JavaScript/Reference/Global_Objects/Date"><code>Date</code></a> to conform with ECMA-262

  <ul>
   <li>New constructor <code>Date(year, month, day, [,<em>hours</em> [<em>, minutes</em> [<em>, seconds</em> [<em>, milliseconds</em> ]]]])</code></li>
   <li>Additional method parameters:
    <ul>
     <li><code>setMonth(month[, date])</code></li>
     <li><code>setHours(hours[, min[, sec[, ms]]])</code></li>
     <li><code>setMinutes(min[, sec[, ms]])</code></li>
     <li><code>setSeconds(sec[, ms])</code></li>
    </ul>
   </li>
  </ul>
 </li>
 <li>The length of an array (property length) is now an unsigned, 32-bit integer.</li>
 <li>{{jsxref("Array.prototype.push()")}}: In JavaScript 1.2, the <code>push</code> method returned the last element added to an array. Under JavaScript 1.3, <code>push</code> returns the new length of the array.</li>
 <li>{{jsxref("Array.prototype.slice()")}}: In JavaScript 1.2, the <code>splice</code> method returned the element removed, if only one element was removed (<code>howMany</code> parameter is <code>1</code>). In JavaScript 1.3, <code>splice</code> always returns an array containing the removed elements. If one element is removed, an array of one element is returned.</li>
 <li><a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html#replace">Changes</a> to {{jsxref("String.prototype.replace()")}}.</li>
 <li><a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html#Boolean">Changes</a> to the {{jsxref("Boolean")}} object.</li>
 <li><a href="https://web.archive.org/web/20000815081640/http://developer.netscape.com/docs/manuals/communicator/jsref/js13.html#toString">Changes</a> to <code>toString()</code>.</li>
</ul>

<h2 id="Non-ECMA-262_features_of_JavaScript_1.3">Non-ECMA-262 features of JavaScript 1.3</h2>

<p>The following is a comparison between the June 1998 version of ECMA-262 and JavaScript 1.3. The following features were not part of the standard at that time, but implemented in JavaScript 1.3.</p>

<h3 id="Keywords_and_operators">Keywords and operators</h3>

<ul>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Using_the_Equality_Operators">Strict equality operators</a></li>
 <li>vertical tab (<code>\v</code> or <code>\u000B</code>) as an escape sequence.</li>
</ul>

<h3 id="Statements">Statements</h3>

<ul>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/label"><code>label</code></a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/switch"><code>switch</code></a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/do...while"><code>do...while</code></a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/export"><code>export</code></a></li>
 <li><a href="/zh-TW/docs/Web/JavaScript/Reference/Statements/import"><code>import</code></a></li>
</ul>

<h3 id="Built-in_objects">Built-in objects</h3>

<ul>
 <li>{{jsxref("RegExp")}}</li>
</ul>

<h3 id="Methods_of_built-in_objects">Methods of built-in objects</h3>

<ul>
 <li><code><a href="/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Object/toSource">toSource()</a></code></li>
 <li>{{jsxref("Object.prototype.watch()")}}</li>
 <li>{{jsxref("Object.prototype.unwatch()")}}</li>
 <li>{{jsxref("Function.arity")}}</li>
 <li>{{jsxref("Function.prototype.apply()")}}</li>
 <li>{{jsxref("Function.prototype.call()")}}</li>
 <li>{{jsxref("Array.prototype.concat()")}}</li>
 <li>{{jsxref("Array.prototype.pop()")}}</li>
 <li>{{jsxref("Array.prototype.push()")}}</li>
 <li>{{jsxref("Array.prototype.shift()")}}</li>
 <li>{{jsxref("Array.prototype.slice()")}}</li>
 <li>{{jsxref("Array.prototype.splice()")}}</li>
 <li>{{jsxref("String.prototype.concat()")}}</li>
 <li>{{jsxref("String.prototype.concat()")}}</li>
 <li>{{jsxref("String.prototype.match()")}}</li>
 <li>{{jsxref("String.prototype.search()")}}</li>
 <li>{{jsxref("String.prototype.slice()")}}</li>
 <li>{{jsxref("String.prototype.substr()")}}</li>
</ul>