As follows
var ary = /h/('hello') ;
alert(ary);
Error reported in IE6/7/8/9
The latest versions of Firefox/Safari/Chrome/Opera all pop up "h"
The above writing method is equivalent to
var ary = /h /.exec('hello');
That is, when using the exec method in Firefox/Safari/Chrome/Opera browsers, you can remove "exec" and use "regular direct ()" method use.
IE10 Platform Preview still does not support this abbreviation.
Related:
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp/exec
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn