// find the max length of string elements in an array arr = ['1', '12', '123']; max = Math.max(...arr.map(element => element.length)); // returns 3, the length of the string '123'