Foreach v jquery

Príklady kódu

82
0

javascript foreach

const avengers = ['thor', 'captain america', 'hulk'];
avengers.forEach((item, index)=>{
	console.log(index, item)
})
27
0

jquery každý

$( "li" ).each(function( index ) {
  console.log( index + ": " + $( this ).text() );
});
21
0

jquery každý

//Array
$.each( arr, function( index, value ){
    sum += value;
});

//Object
$.each( obj, function( key, value ) {
    sum += value;
});
18
0

jQuery slučka nad prvkami

$( "li" ).each(function( index ) {
  console.log( index + ": " + $( this ).text() );
});
15
0

jQuery slučka cez pole

var arr = ['one','two','three','four','five'];
$.each(arr, function(index, value){
	console.log('The value at arr[' + index + '] is: ' + value);
});
4
0

jquery foreach

$.each( obj, function( key, value ) {
  alert( key + ": " + value );
});

V iných jazykoch

Táto stránka je v iných jazykoch

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................