JSFiddle - React, Tailwind, and code Playground
JavaScript
var docs = [
{ "description": "this is string 1" },
{ "description": "this is a long string" },
{ "description": "this is a long string" },
{ "description": "this is a long string" },
{ "description": "this is a long string" },
{ "description": "this is a long string" }
];
docs.map(function(currentValue, index, array){
currentValue['description'] = currentValue.description.slice(0,currentValue.description.length);
return array;
});
// console.log( docs );
console.log( docs[0].description + "long string" );