/midterm-ec

https://arkiteckt.github.io/midterm-ec/

Primary LanguageJavaScript

Midterm Extra Credit

Create a main.js file with your solution to the problem. Fork/Clone and submit by the end of the weekend for credit!

  • twoSmallest
    • Write a function called twoSmallest that takes in a single array of numbers as a parameter and returns the smallest two numbers in the following array format where the smallest number always comes before the 2nd smallest number (ie, the bigger number should come second):
    • [smallestNumber, secondSmallestNumber]
    • If the array is shorter than length 2, return undefined to the user
    • You can assume that every number in the array will be unique
    • Do not use .sort()