Ad
Fundamentals
Arrays
Data Types

Given an array of numbers, return the third greatest number in the array.
You will always be given an array of valid numbers with at least three values.

Ex:
thirdGreatest([4,8,1,5,3]) -> 4

function thirdGreatest(arr){
  return arr.sort( (a,b) => a - b)[arr.length-3]
}
Fundamentals
Strings
Data Types

You will be given a number of minutes. Your task is to return a string that formats the number into 'hours:minutes". Make sure you always return two intigers for the minutes section of the conversion.
ie ('0:01' instead of '0:1')

Example:

minutes(90) => '1:30'

function minutes(num){
  return num % 60 < 10 ? Math.floor(num/60) + ':' + '0' + (num % 60) : Math.floor(num/60) + ':' + (num % 60)
}

For a given number (num) add up all numbers from 0 to num.
This is similar to a factorial, but using addition.

function numSum(num){
  var sum = 0;
  for (var i = 1; num >= i; i++) {
   sum += i
  }
  return sum
};

Find the longest word in a given string.
Assume all strings will contain only letters and spaces.

function longestString(str){
  return str.split(' ').sort(function(a,b) { 
   return b.length - a.length
  })[0]
}