forEach implementation for Objects/NodeLists/Arrays, automatic type looping, scope changes