Refactor for loops
Summary: For loops have been refactored to use more idiomatic JavaScript functions (filter(), some(), forEach()) where appropriate.
Test Plan: Ensure no regressions in modified components
Reviewers: Kirigami, mart
Reviewed By: Kirigami, mart
Subscribers: broulik, ngraham, plasma-devel
Tags: Kirigami
Differential Revision: https://phabricator.kde.org/D28666