in javascript make a for/of code example
Example 1: javascript for of
const numbers = [1,2,3,4];
for(const item of numbers){
console.log(item);
}
Example 2: use these instead of a for loop javascript
const array = [1,2,3,4,5];const evenNumbers = array.filter(function(elem) { // expressions that return 'true' are retained return elem % 2 == 0;});