JSFiddle - React, Tailwind, and code Playground
JavaScript
var arr = ['ben', 'howdle'];
for(key in arr){
console.log(key + ' - ' + arr[key]);
}
arr.forEach(function(value, key){
console.log(key + ' - ' + value);
});
var arr = ['ben', 'howdle'];
for(key in arr){
console.log(key + ' - ' + arr[key]);
}
arr.forEach(function(value, key){
console.log(key + ' - ' + value);
});