I have an array(foo) of objects, each of which has a field called "text" and some of them are very long texts; so I wnat to have a limit of 100 charachters for text; would you do the same approach for cutting to 100 characters in javascript? I belive there is better ways of doing that...Or if it is already clean could you please confirm me? Thanks
results = foo.map(function(obj){
if(obj['text'] && obj['text'].length >100){
obj['text'] = obj['text'].substr(0,97)+"...";
}
return obj;
})