Example javascript array and all method with example

1 Replies, 568 Views

Example javascript array and all method with example.
(This post was last modified: 11-06-2023, 01:04 PM by Admin.)
Code:
var exampleArray = [1, 2, 3, 4, 5];

exampleArray.forEach(function(element) {
  console.log(element);
});
// Output: 1, 2, 3, 4, 5
(This post was last modified: 11-06-2023, 01:03 PM by Admin.)



Users browsing this thread: 1 Guest(s)