<script type="text/javascript"> var items = [1,5,3,4]; $.each(items, function(i,index) { console.log('this is ' + index); }); var newItems = $.map(items, function(i,index) { return i; }); console.log(newItems) </script>2、输出结果:
this is 1 this is 5 this is 3 this is 4 [1, 5, 3, 4]