JSFiddle - React, Tailwind, and code Playground

by bhupendra negi

JavaScript

var $array = [1,2,3,4,5];

function fun1(i){
 return i+1;

}

function fun2()
{
    return this+1;
}



var items1 = $.map($array,fun1);
var items2 = $.each($array,fun1);

console.log("map result " + items1);
console.log("each result " + items2);