workaround a BB10 JavaScript VM bug by doing forEach differently refs #17204