{"size": 485, "ext": "js", "max_stars_repo_path": "HackerRank/10-Days-Of-JavaScript/Day 3/arrays.js", "max_stars_repo_name": "tareqmahmud/Competitive-Programming", "max_stars_repo_stars_event_min_datetime": "2020-11-19T19:03:28.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-04T19:52:11.000Z", "max_issues_repo_path": "10-Days-Of-JavaScript/Day 3/arrays.js", "max_issues_repo_name": "tareqmahmud/HackerRank", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "10-Days-Of-JavaScript/Day 3/arrays.js", "max_forks_repo_name": "tareqmahmud/HackerRank", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.5294117647, "max_line_length": 76, "alphanum_fraction": 0.6453608247}
/**
 *   Return the second largest number in the array.
 *   @param {Number[]} nums - An array of numbers.
 *   @return {Number} The second largest number in the array.
 **/
function getSecondLargest(nums) {
    // Complete the function

    // Get the only unique value from numbers
    nums = [...new Set(nums)];

    // Then sort that unique numbers with follow the bigger to lower pattern
    nums.sort((x, y) => x < y);

    // Then return the second element
    return nums[1];
}