JSFiddle - React, Tailwind, and code Playground
by Trae
JavaScript
function generateIncrementedValue(a, n) {
return !a.length ? 1 : Math.max.apply(Math,
$.map(a, function (v, i) {
return (v[n]);
})) + 1;
}
console.log(generateIncrementedValue([{
id: 53
}, {
id: 4
}], "id"))