Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find smallest length string in an array js

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

console.log(
  arr.reduce((a, b) => a.length <= b.length ? a : b)
)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #smallest #length #string #array #js
ADD COMMENT
Topic
Name
6+4 =