toStringbeginnerconst re = /hello/gi
console.log(re.toString()) // β '/hello/gi'Use RegExp.toString() to get the string representation of the regular expression including its flags.
toString() always returns a string.
Challenge: Verify that typeof /abc/g.toString() is 'string'.