Is there a way to determine the shortest string in a JavaScript array regardless of the number of elements it contains? I attempted using
var min = Math.min(arr[0].length,arr[1].length,arr[2].length);
to find the shortest string among 3 elements in an array. However, I am looking for a solution that does not require specifying the exact number of elements.