String.prototype.replace

The first argument is a regular expression

The second parameter is a replacer

 

The function parameters as follows:

 

replace (game, p1, p2, p3 ..

In fact, the equivalent of

replacer($&,$1,$2,$3..

 

Information:  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace

 

Guess you like

Origin www.cnblogs.com/eret9616/p/11598142.html