Create a JavaScript program to print the maximum and minimum of given numbers?
// Create a JavaScript program to print the maximum and minimum of given numbers 

function printMaxAndMin(nums) { 
    var min = Math.min.apply(null, nums); // Get the minimum 
    var max = Math.max.apply(null, nums); // Get the maximum 
    console.log("Min: " + min + " Max: " + max); 
} 
  
var nums = [2,4,8,10]; 
printMaxAndMin(nums);
JavaScript program to print the maximum and minimum of given numbers:

Console Output: {
  "maximum" : 10,
  "minimum" : -10
 }