Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

for each

const array1 = ['a', 'b', 'c'];

array1.forEach(element => console.log(element));

// expected output: "a"
// expected output: "b"
// expected output: "c"
Comment

each function

function each(coll, func) { 
       if (Array.isArray(coll)) { 
             for (var i = 0; i < coll.length; i++) { 
                   func(coll[i], i); 
             } 
       } else { 
             for (var key in coll) { 
                   func(coll[key], key); 
             } 
       } 
 }
Comment

PREVIOUS NEXT
Code Example
Javascript :: Get title assert 
Javascript :: Get Parameters Of URL As A String 
Javascript :: check if token is expired 
Javascript :: how to use fetch api 
Javascript :: js extract properties from object 
Javascript :: javascript factory functions 
Javascript :: convert text to qr code in angular 
Javascript :: custom eslint config react hooks 
Javascript :: javascript function return 
Javascript :: react form validation 
Javascript :: material-ui.com autocomplete grouped 
Javascript :: materal ui react range slider 
Javascript :: react date picker 
Javascript :: javascript repeat function 
Javascript :: elastic search host using docker 
Javascript :: react footer component 
Javascript :: luxy js 
Javascript :: No match found for location with path 
Javascript :: reactstrap search bar 
Javascript :: react native bottom sheet above the bottom menu 
Javascript :: react native add react native vector icons not working 
Javascript :: Button get specific input hidden value JQuery 
Javascript :: javascript try...catch...finally 
Javascript :: how to get time zone difference date-fns 
Javascript :: shopify template routing map 
Javascript :: node js serve pdf file 
Javascript :: Authentication handling in javascript 
Javascript :: set meterial icon color change onClick react 
Javascript :: js string to num 
Javascript :: UnhandledPromiseRejectionWarning 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =