Originally Posted by AndrewGSW
If you remove the "g" global modifier - which is not relevant to test() - then it behaves as expected.
You are right! Woot!
We learn something every day. Sometimes something worth knowing!
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.