Use native ES5 Array prototype methods instead of jQuery
Replace
- $.each( array, function ( index, value ) { ... } ) by array.forEach( function ( value ) { ... } )
- $.each( array, function () { ... this ... } ) by array.forEach( function ( value ) { ... value ... } )
Also replace forEach by map, to simplify the code.
Change-Id: I657c737d356cb6e310bc6351a7869a60955ebed9