Nested forEach calls are not a great idea for the constructor of widgets, since each iteration necessarily incurs a function call. In these situations, optimization performance concerns make it better to just bite the bullet and write the loop code the old fashioned way.