simplified test:

the typeof test is included in the !== comparison of the values