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 706339 of Deprecated and obsolete features

  • Revision slug: Web/JavaScript/Reference/Deprecated_and_obsolete_features
  • Revision title: Deprecated and obsolete features
  • Revision id: 706339
  • Created:
  • Creator: arai
  • Is current revision? No
  • Comment Bug 1103158 - Remove all non-standard features

Revision Content

{{JsSidebar("More")}}

This page lists features of JavaScript that are deprecated (that is, still available but planned for removal) and obsolete (that is, no longer usable).

Deprecated features

These deprecated features can still be used, but should be used with caution because they are expected to be removed entirely sometime in the future. You should work to remove their use from your code.

RegExp properties

The following properties are deprecated. This does not affect their use in {{jsxref("Global_Objects/String/replace", "replacement strings", "", 1)}}:

Property Description
$1, ..., $9

Parenthesized substring matches, if any.
Warning: Using these properties can result in problems, since browser extensions can modify them. Avoid them!

$_ See input.
$* See multiline.
$& See lastMatch.
$+ See lastParen.
$` See leftContext.
$' See rightContext.
input The string against which a regular expression is matched.
lastMatch The last matched characters.
lastParen The last parenthesized substring match, if any.
leftContext The substring preceding the most recent match.
rightContext The substring following the most recent match.

The following are now properties of RegExp instances, no longer of the RegExp object:

Property Description
global Whether or not to test the regular expression against all possible matches in a string, or only against the first.
ignoreCase Whether or not to ignore case while attempting a match in a string.
lastIndex The index at which to start the next match.
multiline Whether or not to search in strings across multiple lines.
source The text of the pattern.

RegExp methods

  • The compile method is deprecated.
  • The valueOf method is no longer specialized for RegExp. Use Object.valueOf.

Function properties

  • The {{jsxref("Global_Objects/Function/caller", "caller")}} and {{jsxref("Global_Objects/Function/arguments", "arguments")}} properties are deprecated, because they leak the function caller. Instead of the arguments property, you should use the {{jsxref("Functions/arguments", "arguments")}} object inside function closures.

Legacy generator

  • {{jsxref("Statements/Legacy_generator_function", "Legacy generator function statement")}} and {{jsxref("Operators/Legacy_generator_function", "Legacy generator function expression")}} are deprecated. Use {{jsxref("Statements/function*", "function* statement")}} and {{jsxref("Operators/function*", "function* expression")}} instead.

Iterator

  • {{jsxref("Global_Objects/StopIteration", "StopIteration")}} is deprecated.
  • {{jsxref("Global_Objects/Iterator", "Iterator")}} is deprecated.

Object methods

  • {{jsxref("Global_Objects/Object/watch", "watch")}} and {{jsxref("Global_Objects/Object/unwatch", "unwatch")}} are deprecated. Use {{jsxref("Global_Objects/Proxy", "Proxy")}} instead.
  • __iterator__ is deprecated.

Date methods

  • {{jsxref("Global_Objects/Date/getYear", "getYear")}} and {{jsxref("Global_Objects/Date/setYear", "setYear")}} are affected by the Year-2000-Problem and have been subsumed by {{jsxref("Global_Objects/Date/getFullYear", "getFullYear")}} and {{jsxref("Global_Objects/Date/setFullYear", "setFullYear")}}.
  • You should use {{jsxref("Global_Objects/Date/toISOString", "toISOString")}} instead of the deprecated {{jsxref("Global_Objects/Date/toGMTString", "toGMTString")}} method in new code.
  • {{jsxref("Global_Objects/Date/toLocaleFormat", "toLocaleFormat")}} is deprecated.

let

  • {{jsxref("Statements/let", "let block", "#let_block")}} and {{jsxref("Statements/let", "let expressions", "#let_expressions")}} are deprecated.

Escape sequences

  • Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals.
  • The {{jsxref("Global_Objects/escape", "escape")}} and {{jsxref("Global_Objects/unescape", "unescape")}} functions are deprecated. Use {{jsxref("Global_Objects/encodeURI", "encodeURI")}}, jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent")}}, {{jsxref("Global_Objects/decodeURI", "decodeURI")}} or {{jsxref("Global_Objects/decodeURIComponent", "decodeURIComponent")}} to encode and decode escape sequences for special characters.

String methods

  • HTML wrapper methods like {{jsxref("String.prototype.fontsize")}} and {{jsxref("String.prototype.big")}}.
  • {{jsxref("String.prototype.quote")}} is removed from Firefox 37.
  • non standard flags parameter in {{jsxref("String.prototype.search")}}, {{jsxref("String.prototype.match")}}, and {{jsxref("String.prototype.replace")}} are deprecated.

Obsolete features

These obsolete features have been entirely removed from JavaScript and can no longer be used as of the indicated version of JavaScript.

Object

Property Description
{{jsxref("Global_Objects/Object/count", "__count__")}} Returns the number of enumerable properties directly on a user-defined object.
{{jsxref("Global_Objects/Object/Parent", "__parent__")}} Points to an object's context.
Method Description
{{jsxref("Global_Objects/Object/eval", "Object.prototype.eval()")}} Evaluates a string of JavaScript code in the context of the specified object.

Function

Property Description
{{jsxref("Global_Objects/Function/arity", "arity")}} Number of formal arguments.

Number

  • {{jsxref("Number.toInteger()")}}

ParallelArray

  • {{jsxref("ParallelArray")}}

Statements

  • {{jsxref("Statements/for_each...in", "for each...in")}} is deprecated. Use {{jsxref("Statements/for...of", "for...of")}} instead.
  • Destructuring {{jsxref("Statements/for...in", "for...in")}} is deprecated. Use {{jsxref("Statements/for...of", "for...of")}} instead.

E4X

See E4X for more information.

Sharp variables

See Sharp variables in JavaScript for more information.

Revision Source

<div>
 {{JsSidebar("More")}}</div>
<p>This page lists features of JavaScript that are deprecated (that is, still available but planned for removal) and obsolete (that is, no longer usable).</p>
<h2 id="Deprecated_features">Deprecated features</h2>
<p>These deprecated features can still be used, but should be used with caution because they are expected to be removed entirely sometime in the future. You should work to remove their use from your code.</p>
<h3 id="RegExp_Properties" name="RegExp_Properties">RegExp properties</h3>
<p>The following properties are deprecated. This does not affect their use in {{jsxref("Global_Objects/String/replace", "replacement strings", "", 1)}}:</p>
<table class="standard-table">
 <tbody>
  <tr>
   <th>Property</th>
   <th>Description</th>
  </tr>
  <tr>
   <td><code>$1, ..., $9</code></td>
   <td>
    <p>Parenthesized substring matches, if any.<br />
     <strong>Warning:</strong> Using these properties can result in problems, since browser extensions can modify them. Avoid them!</p>
   </td>
  </tr>
  <tr>
   <td><code>$_</code></td>
   <td>See <code>input</code>.</td>
  </tr>
  <tr>
   <td><code>$*</code></td>
   <td>See <code>multiline</code>.</td>
  </tr>
  <tr>
   <td><code>$&amp;</code></td>
   <td>See <code>lastMatch</code>.</td>
  </tr>
  <tr>
   <td><code>$+</code></td>
   <td>See <code>lastParen</code>.</td>
  </tr>
  <tr>
   <td><code>$`</code></td>
   <td>See <code>leftContext</code>.</td>
  </tr>
  <tr>
   <td><code>$'</code></td>
   <td>See <code>rightContext</code>.</td>
  </tr>
  <tr>
   <td><code>input</code></td>
   <td>The string against which a regular expression is matched.</td>
  </tr>
  <tr>
   <td><code>lastMatch</code></td>
   <td>The last matched characters.</td>
  </tr>
  <tr>
   <td><code>lastParen</code></td>
   <td>The last parenthesized substring match, if any.</td>
  </tr>
  <tr>
   <td><code>leftContext</code></td>
   <td>The substring preceding the most recent match.</td>
  </tr>
  <tr>
   <td><code>rightContext</code></td>
   <td>The substring following the most recent match.</td>
  </tr>
 </tbody>
</table>
<p>The following are now properties of RegExp instances, no longer of the RegExp object:</p>
<table class="standard-table">
 <tbody>
  <tr>
   <th>Property</th>
   <th>Description</th>
  </tr>
  <tr>
   <td><code>global</code></td>
   <td>Whether or not to test the regular expression against all possible matches in a string, or only against the first.</td>
  </tr>
  <tr>
   <td><code>ignoreCase</code></td>
   <td>Whether or not to ignore case while attempting a match in a string.</td>
  </tr>
  <tr>
   <td><code>lastIndex</code></td>
   <td>The index at which to start the next match.</td>
  </tr>
  <tr>
   <td><code>multiline</code></td>
   <td>Whether or not to search in strings across multiple lines.</td>
  </tr>
  <tr>
   <td><code>source</code></td>
   <td>The text of the pattern.</td>
  </tr>
 </tbody>
</table>
<h3 id="RegExp_Methods" name="RegExp_Methods">RegExp methods</h3>
<ul>
 <li>The <code>compile</code> method is deprecated.</li>
 <li>The <code>valueOf</code> method is no longer specialized for RegExp. Use <code>Object.valueOf</code>.</li>
</ul>
<h3 id="Function_properties">Function properties</h3>
<ul>
 <li>The {{jsxref("Global_Objects/Function/caller", "caller")}} and {{jsxref("Global_Objects/Function/arguments", "arguments")}} properties are deprecated, because they leak the function caller. Instead of the arguments property, you should use the {{jsxref("Functions/arguments", "arguments")}} object inside function closures.</li>
</ul>
<h3 id="Legacy_generator">Legacy generator</h3>
<ul>
 <li>{{jsxref("Statements/Legacy_generator_function", "Legacy generator function statement")}} and {{jsxref("Operators/Legacy_generator_function", "Legacy generator function expression")}} are deprecated. Use {{jsxref("Statements/function*", "function* statement")}} and {{jsxref("Operators/function*", "function* expression")}} instead.</li>
</ul>
<h3 id="Iterator">Iterator</h3>
<ul>
 <li>{{jsxref("Global_Objects/StopIteration", "StopIteration")}} is deprecated.</li>
 <li>{{jsxref("Global_Objects/Iterator", "Iterator")}} is deprecated.</li>
</ul>
<h3 id="Date_methods">Object methods</h3>
<ul>
  <li>{{jsxref("Global_Objects/Object/watch", "watch")}} and {{jsxref("Global_Objects/Object/unwatch", "unwatch")}} are deprecated. Use {{jsxref("Global_Objects/Proxy", "Proxy")}} instead.</li>
  <li><code>__iterator__</code> is deprecated.</li>
</ul>
<h3 id="Date_methods">Date methods</h3>
<ul>
 <li>{{jsxref("Global_Objects/Date/getYear", "getYear")}} and {{jsxref("Global_Objects/Date/setYear", "setYear")}} are affected by the Year-2000-Problem and have been subsumed by {{jsxref("Global_Objects/Date/getFullYear", "getFullYear")}} and {{jsxref("Global_Objects/Date/setFullYear", "setFullYear")}}.</li>
 <li>You should use {{jsxref("Global_Objects/Date/toISOString", "toISOString")}} instead of the deprecated {{jsxref("Global_Objects/Date/toGMTString", "toGMTString")}} method in new code.</li>
 <li>{{jsxref("Global_Objects/Date/toLocaleFormat", "toLocaleFormat")}} is deprecated.</li>
</ul>
<h3 id="let">let</h3>
<ul>
  <li>{{jsxref("Statements/let", "let block", "#let_block")}} and {{jsxref("Statements/let", "let expressions", "#let_expressions")}} are deprecated.</li>
</ul>
<h3 id="Escape_Sequences" name="Escape_Sequences">Escape sequences</h3>
<ul>
 <li>Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals.</li>
 <li>The {{jsxref("Global_Objects/escape", "escape")}} and {{jsxref("Global_Objects/unescape", "unescape")}} functions are deprecated. Use {{jsxref("Global_Objects/encodeURI", "encodeURI")}}, jsxref("Global_Objects/encodeURIComponent", "encodeURIComponent")}}, {{jsxref("Global_Objects/decodeURI", "decodeURI")}} or {{jsxref("Global_Objects/decodeURIComponent", "decodeURIComponent")}} to encode and decode escape sequences for special characters.</li>
</ul>
<h3 id="String_methods">String methods</h3>
<ul>
 <li><a href="https://developer.mozilla.org/en-US/docs/tag/HTML%20wrapper%20methods">HTML wrapper methods</a> like {{jsxref("String.prototype.fontsize")}} and {{jsxref("String.prototype.big")}}.</li>
 <li>{{jsxref("String.prototype.quote")}} is removed from Firefox 37.</li>
 <li>non standard <code>flags</code> parameter in {{jsxref("String.prototype.search")}}, {{jsxref("String.prototype.match")}}, and {{jsxref("String.prototype.replace")}} are deprecated.</li>
</ul>
<h2 id="Obsolete_features">Obsolete features</h2>
<p>These obsolete features have been entirely removed from JavaScript and can no longer be used as of the indicated version of JavaScript.</p>
<h3 id="Object">Object</h3>
<table class="standard-table">
 <tbody>
  <tr>
   <th>Property</th>
   <th>Description</th>
  </tr>
  <tr>
   <td>{{jsxref("Global_Objects/Object/count", "__count__")}}</td>
   <td>Returns the number of enumerable properties directly on a user-defined object.</td>
  </tr>
  <tr>
   <td>{{jsxref("Global_Objects/Object/Parent", "__parent__")}}</td>
   <td>Points to an object's context.</td>
  </tr>
 </tbody>
</table>
<table class="standard-table">
 <tbody>
  <tr>
   <th>Method</th>
   <th>Description</th>
  </tr>
  <tr>
   <td>{{jsxref("Global_Objects/Object/eval", "Object.prototype.eval()")}}</td>
   <td>Evaluates a string of JavaScript code in the context of the specified object.</td>
  </tr>
 </tbody>
</table>
<h3 id="Function">Function</h3>
<table class="standard-table">
 <tbody>
  <tr>
   <th>Property</th>
   <th>Description</th>
  </tr>
  <tr>
   <td>{{jsxref("Global_Objects/Function/arity", "arity")}}</td>
   <td>Number of formal arguments.</td>
  </tr>
 </tbody>
</table>
<h3 id="Number">Number</h3>
<ul>
 <li>{{jsxref("Number.toInteger()")}}</li>
</ul>
<h3 id="ParallelArray">ParallelArray</h3>
<ul>
 <li>{{jsxref("ParallelArray")}}</li>
</ul>
<h3 id="Statements">Statements</h3>
<ul>
 <li>{{jsxref("Statements/for_each...in", "for each...in")}} is deprecated. Use {{jsxref("Statements/for...of", "for...of")}} instead.</li>
 <li>Destructuring {{jsxref("Statements/for...in", "for...in")}} is deprecated. Use {{jsxref("Statements/for...of", "for...of")}} instead.</li>
</ul>
<h3 id="E4X">E4X</h3>
<p>See <a href="/en-US/docs/Archive/Web/E4X">E4X</a> for more information.</p>
<h3 id="Sharp_variables">Sharp variables</h3>
<p>See <a href="/en-US/docs/Archive/Web/Sharp_variables_in_JavaScript">Sharp variables in JavaScript</a> for more information.</p>
Revert to this revision