Warm up

Write a function that returns the missing number from an unsorted array of numbers.

  • Create a function that identifies the range of numbers within a given array.
  • Have the function return all numbers missing within the range.


function findMissingNo([3,5,4,8,1,2,7]){
//Find and return the missing number(s)

//Output: 6


  • The array has at least 3 elements.
  • There are no repeated numbers.

Test cases:

//Output: 4
[12,10, 9] 
//Output: 11
//Output: 1

Optional Conditions:

  • The array has any number of elements.
  • The array has repeated numbers.
  • The function returns the mean, median, and mode.