JavaScript Objects The RegExp Object- toSource () - Javascript Objects

What is JavaScript - RegExp toSource Method?

The JavaScript toSource method string indicates the source code of the object.

toSource method will not work with all the modern browsers.

Syntax

Its syntax is as follows −


Return Value

Returns the string representing the source code of the object.

Example

Try the following example program.


Output

Test 1 - returned value : /script/g

Test 2 - returned value : ///g


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Javascript Objects Topics