Write a JavaScript function to get nth largest element from an unsorted array.
Contents