<prompt> Write a function in JavaScript that takes an array of numbers as input and finds the second highest number in the array.11, 2, 31, 7, 15  <response>: Heres the solution code in JavaScript:javascriptfunction findSecondHighestarr remove duplicates from array let uniqueArray ...new Setarr; sort the array in descending order uniqueArray.sortfunctiona, b return b - a; ; return second element return uniqueArray1;console.logfindSecondHighest11, 2, 31, 7, 15; 