jquery - Obtain key value in for each in Javascript like PHP -


i can in php:

foreach ($array $pos=>$value) {     .... } 

but don't know how in javascript or jquery. want use $pos.

var range = [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10];  $.each( range, function( index , value ) {        console.log( value ); }); 

documentatión method:

https://api.jquery.com/each/


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -