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.


Its syntax is as below −

Return Value

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


Try the following example program.


Test1 - Global property is not set

Test2 - Global property is set

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

Javascript Objects Topics