Skip to content
Advertisement

Tag: foreach

Replace selector with array item

I would like to archive that I have an Array, with 3-4 Items and then I want to itterate throw all of them and change the selector in the function with the items of the array. then my function and then the foreach .btn should be like name or person, and I want maybe to add late more Items to

Substring all aria-label elements of an array

HTML Here I have a JS script working to get the number of the active slide in result of a variable. to get it, I’ve substring info from “aria-label” (keeping only slide number before ” / 13″) of the active slide: result // numactiveslide: “4” **How to get the same for not 1 but 3 special slides (prev,active,next). I try

A function which takes an array as argument, with a forEach loop which console.log each element and each index for every iteration inside the function

I have to create a function which takes an array as argument, with a forEach loop which console.log each element and each index for every iteration inside the function. Also inside the function declare a variable called count, and increment it by one for each iteration then return count. I wrote this function: But I get the following error: How

Advertisement