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.


Its syntax is as follows −

Return Value

Returns the string representing the source code of the object.


Try the following example program.


Test 1 - returned value : /script/g

Test 2 - returned value : ///g

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

Javascript Objects Topics