JSFiddle - React, Tailwind, and code Playground

JavaScript

var numArray = [{1:1},{2:2}];


numArray.forEach(function(value,index){
    console.log(value,index,this);//{1:1},0 window
});