[11, 2, 31, 7, 15]
编写一个 JavaScript 函数，以一个数字数组作为输入，并找到数组中第二高的数字。
function findSecondHighest(arr) {
  let highestNumber = 0;
  let secondHighestNumber = 0;
  arr.forEach(number => {
    if (number > highestNumber) {
      secondHighestNumber = highestNumber;
      highestNumber = number;
    } else if (number > secondHighestNumber && number != highestNumber) {
      secondHighestNumber = number;
    }
  });
  return secondHighestNumber;
}