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

What is JavaScript - RegExp global Property?

JavaScript global is a read-only boolean property of RegExp objects. It defines whether a desired regular expression performs global matching, i.e., whether it was created with the alphabet "g" attribute.


Syntax

Its syntax is as below −


Return Value

It Returns "TRUE" if the "g" modifier is set, "FALSE" otherwise.

Example

Try the following example program.


Output

Test1 - Global property is not set

Test2 - Global property is set


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

Javascript Objects Topics