What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-16 22:30:12
javascript loop through arrya
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Javascript 2022-03-16 16:30:04
get all from dir node
//requiring path and fs modules const path = require('path'); const fs = require('fs'); //joining path of directory const directoryPath = path.join(__dirname, 'Documents'); //passsing directoryPath and callback function fs.readdir(directoryPath, functio... Add solution -
Javascript 2022-02-28 14:40:05
node list files in directory
//requiring path and fs modules const path = require('path'); const fs = require('fs'); //joining path of directory const directoryPath = path.join(__dirname, 'Documents'); //passsing directoryPath and callback function fs.readdir(directoryPath, functio... Add solution -
Javascript 2022-02-17 18:40:44
loop array of objects
/* new options with IE6: loop through array of objects */ const people = [ {id: 100, name: 'Vikash'}, {id: 101, name: 'Sugam'}, {id: 102, name: 'Ashish'} ]; // using for of for (let persone of people) { console.log(persone.id + ': ' + persone.na... Add solution -
Javascript 2022-02-16 18:35:08
loop through an array in js
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Java 2022-02-01 05:30:10
ArrayList forEach(Consumer super action) method in java
import java.util.ArrayList; public class ArrayListForEachMethodExample { public static void main(String[] args) { ArrayList<Integer> al = new ArrayList<Integer>(); al.add(10); al.add(50); al.add(20); al.add(... Add solution -
Javascript 2021-11-14 21:43:22
node js get files in dir
//requiring path and fs modules const path = require('path'); const fs = require('fs'); //joining path of directory const directoryPath = path.join(__dirname, 'Documents'); //passsing directoryPath and callback function fs.readdir(directoryPath, functio... Add solution -
Javascript 2021-11-13 11:44:18
loop through an array javascript
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Javascript 2021-11-13 09:05:20
loop through array javascript
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Javascript 2021-11-12 18:05:16
javascript through array
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution