JSFiddle - React, Tailwind, and code Playground

by Kevin Faulhaber

JavaScript

var obj = [{
    id:1, name:'test1', time:'time1'
}, {
    id:2, name:'test2', time:'time2'
}, {
    id:3, name:'test3', time:'time3'
}];

Array.prototype.mapIndividual = function (callback) {
    setTimeout(function () {
        for (var i = 0; i < this.length; i++) {
            callback.call(this, i, this[i].time);
        }
    }.bind(this), 0);
};

obj.mapIndividual(function(index, time){
    console.log(index + ' ' + time);
});