Chrome Extension

Find the shortest string in array

let arr = ["aaaa", "aa", "aa", "aaaaa", "a", "aaaaaaaa"];

console.log(
  arr.reduce(function(a, b) {
    return a.length <= b.length ? a : b;
  })
)
// result a
We are a bunch of lazy programmers so we developed this chrome extension
search code from your favorite search engine
Install Now

Find the shortest string in array

Search Index Data (The code snippet can also be found with below search text)

Find the shortest string in array
Was this helpful?
0 Comments
Open Code Manager We are hiring