adjusted toArray & typeOf functions to account for NodeList bs in Safari