Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - A strange JS code. Please explain.
A strange JS code. Please explain.
\x24 1' is the corresponding character' $' in octal notation' \x24', so' \x24 1' is equivalent to' $ 1'.

RegExp['$ 1']: It is another way to call the JS property, which is equivalent to regexp. Each attribute in $ 1.js is equivalent to an array element.

+RegExp['\x24 1'] is equivalent to +RegExp. $ 1.

Regular expression. $ 1 is the first capture to extract a regular match,+can convert the following "plastic string" into "plastic".

So browser.chrome =+regexp ['\ x 241']; The explanation for this is:

Convert the first string captured periodically to an integer and assign it to browser.chrome.

Simply put, a hypothetical object A has the property A..

There are two ways to access these properties:

1: AD

2:A['a']

So regexp ['$ 1'] = regexp. $ 1.