JavaScript 1.5 version: Deprecated Featuresess validation
RegExp (Regular expression) Properties
The following properties are deprecated.
Property | Description |
---|---|
$1, ..., $9 | Parenthesized substring matches, if any. |
$_ | The string against which a regular expression is matched. |
$* | Reflects whether or not to search in strings across multiple lines. |
$& | The last matched characters. |
$+ | The last parenthesized substring match. |
$` | The substring preceding the most recent match |
$' | The substring following the most recent match |
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. |
RegExp (Regular expression) Methods
The compile method is deprecated.
The valueOf method is no longer specialized for RegExp. Use Object.valueOf.
Escape sequences
Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals.
The escape and unescape functions are deprecated. Use encodeURI, encodeURIComponent, decodeURI or decodeURIComponent to encode and decode escape sequences for special characters.
Previous: Debug JavaScript with Firebug
Next: JavaScript - Exercises, Practice, Solution
Test your Programming skills with w3resource's quiz.
JavaScript: Tips of the Day
How to insert an item into an array at a specific index (JavaScript)?
What you want is the splice function on the native array object.
arr.splice(index, 0, item); will insert item into arr at the specified index (deleting 0 items first, that is, it's just an insert). In this example we will create an array and add an element to it into index 2:
var arr = []; arr[0] = "Jani"; arr[1] = "Hege"; arr[2] = "Stale"; arr[3] = "Kai Jim"; arr[4] = "Borge"; console.log(arr.join()); arr.splice(2, 0, "Lene"); console.log(arr.join());
Ref: https://bit.ly/2BXbp04
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework