Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js math function that returns smallest value

console.log(Math.min(2, 3, 1));
// expected output: 1

console.log(Math.min(-2, -3, -1));
// expected output: -3

const array1 = [2, 3, 1];

console.log(Math.min(...array1));
// expected output: 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #math #function #returns #smallest
ADD COMMENT
Topic
Name
8+8 =