Deprecated and obsolete features
본 페이지는 자바스크립트의 제외 예정인(즉, 아직 사용할 수 있지만 제거 계획이 있는) 기능과 제외된(즉, 더 이상 사용할 수 없는) 기능을 나열합니다.
제외 예정 기능
아래 기능은 아직 사용할 수 있지만, 언젠가 제거될 예정이므로 주의를 기울여야 합니다. 작성한 코드가 항목 중 하나를 포함하고 있다면 제거해야 합니다.
RegExp 속성
아래 속성은 제외 예정입니다. 이는 String.replace
사용에 영향을 주지 않습니다.
Property | Description |
---|---|
$1-$9 |
Parenthesized substring matches, if any. |
$_ (en-US) |
See input . |
$* |
See multiline . |
$& (en-US) |
See lastMatch . |
$+ (en-US) |
See lastParen . |
$` (en-US) |
See leftContext . |
$' (en-US) |
See rightContext . |
input (en-US) |
The string against which a regular expression is matched. |
lastMatch (en-US) |
The last matched characters. |
lastParen (en-US) |
The last parenthesized substring match, if any. |
leftContext (en-US) |
The substring preceding the most recent match. |
rightContext (en-US) |
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 (en-US) |
The index at which to start the next match. |
multiline |
Whether or not to search in strings across multiple lines. |
source (en-US) |
패턴의 텍스트. |
RegExp 메서드
compile()
(en-US) 메서드는 제외될 예정입니다.valueOf
메서드는 더 이상RegExp
전용이 아닙니다.Object.valueOf()
를 사용하세요.
Function 속성
- The
caller
(en-US) andarguments
properties are deprecated, because they leak the function caller. Instead of the arguments property, you should use thearguments
object inside function closures.
Legacy generator
Legacy generator function statement
(en-US) andLegacy generator function expression
(en-US) are deprecated. Usefunction* statement
andfunction* expression
instead.JS1.7/JS1.8 Array comprehension
(en-US) andJS1.7/JS1.8 Generator comprehension
(en-US) are deprecated.
Iterator
StopIteration
is deprecated.Iterator
(en-US) is deprecated.
Object methods
Date methods
getYear
(en-US) andsetYear
(en-US) are affected by the Year-2000-Problem and have been subsumed bygetFullYear
andsetFullYear
.- You should use
toISOString
instead of the deprecatedtoGMTString
(en-US) method in new code. toLocaleFormat
is deprecated.
Functions
- Expression closures are deprecated. Use regular
functions
or arrow functions instead.
Proxy
- Proxy.create and Proxy.createFunction are deprecated. Use
Proxy
instead. - The following traps are obsolete:
hasOwn
(Firefox bug 980565, Firefox 33).getEnumerablePropertyKeys
(Firefox bug 783829, Firefox 37)getOwnPropertyNames
(Firefox bug 1007334, Firefox 33)keys
(Firefox bug 1007334, Firefox 33)
Escape sequences
- Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals.
- The
escape
(en-US) andunescape
(en-US) functions are deprecated. UseencodeURI
,encodeURIComponent
,decodeURI
ordecodeURIComponent
to encode and decode escape sequences for special characters.
String methods
- HTML wrapper methods like
String.prototype.fontsize
(en-US) andString.prototype.big
(en-US). String.prototype.quote
is removed from Firefox 37.- non standard
flags
parameter inString.prototype.search
,String.prototype.match
, andString.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
- The
Object.prototype.__proto__
accessors are deprecated. UseObject.getPrototypeOf
andObject.setPrototypeOf
instead. This does not apply to the__proto__
literal key in object literals. - The
Object.prototype.__defineGetter__
,Object.prototype.__defineSetter__
,Object.prototype.__lookupGetter__
, andObject.prototype.__lookupSetter__
methods are deprecated. UseObject.getOwnPropertyDescriptor
andObject.defineProperty
instead.
Function
Property | Description |
---|---|
arity |
Number of formal arguments. |
Array
Property | Description |
Array.observe() |
Asynchronously observing changes to Arrays. |
Array.unobserve() |
Remove observers. |
Number
ParallelArray
Statements
for each...in
is deprecated. Usefor...of
instead.- Destructuring
for...in
is deprecated. Usefor...of
instead. - let blocks and let expressions are obsolete.
E4X
See E4X for more information.
Sharp variables
See Sharp variables in JavaScript for more information.