-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharray-loop.js
More file actions
31 lines (22 loc) · 739 Bytes
/
Copy patharray-loop.js
File metadata and controls
31 lines (22 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// If you want to run loop in your array, then follow this technique.
/*
var numbers = [45, 86, 34, 87, 55, 12, 98, 82, 33, 44];
for (var i = 0; i < 7; i++) {
// If you need, You can add variable inside the for loop.
var element = numbers[i];
console.log(element);
}
*/
/*
var numbers = [45, 86, 34, 87, 55, 12, 98, 82, 33, 44];
for (var i = 0; i < numbers.length; i++) {
// If you need, You can add variable inside the for loop.
var element = numbers[i];
console.log(element);
}
*/
var items = ['laptop', 'keyboard', 'mouse', 'speaker', 'usb cable', 'mobile'];
for ( var i = 0; i < items.length; i++) {
var item = items[i];
console.log(item);
}