If you want to use jQuery, it has a nice example in its documentation:
$.each([ 52, 97 ], function( index, value ) {
alert( index + ": " + value );
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
$.each([ 52, 97 ], function( index, value ) {
alert( index + ": " + value );
});