Answers for "find smallest length string in an array js"

10

javascript find smallest number in an array

const arr = [14, 58, 20, 77, 66, 82, 42, 67, 42, 4]
const min = Math.min(...arr)
console.log(min)
Posted by: Guest on February-16-2020
1

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)
)
Posted by: Guest on August-18-2020
1

how to find smallest number in array js

Array.min = function( array ){
    return Math.min.apply( Math, array );
};
Posted by: Guest on November-25-2020
0

find smallest length string in an array js

var arr = ['cats', 'giants', 'daughters', 'ice'];
var min = Math.min(...arr.map(({ length }) => length));
console.log(min);
Posted by: Guest on August-18-2020

Code answers related to "find smallest length string in an array js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language