Computer Science, asked by hemagupta7949, 7 months ago

Give the output: Math.max(2, Math.min(3,4))​

Answers

Answered by smani889887
3

Answer:

console.log(Math.max(1, 3, 2));

// expected output: 3

console.log(Math.max(-1, -3, -2));

// expected output: -1

const array1 = [1, 3, 2];

console.log(Math.max(...array1));

// expected output: 3

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

Answered by poshithai
5

Answer:

3

Explanation:

Math.min(3,4) gives 3 as it displays the minimum of the entered values.

Math.max(2,Math.min(3,4)) gives Math.max(2,3) as explained above. So,the function Math.max(2,3) gives the output as 3.

Similar questions