{"size": 417, "ext": "js", "max_stars_repo_path": "7kyu/sorted.js", "max_stars_repo_name": "matiasg11/CodeWarsSolutions", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "7kyu/sorted.js", "max_issues_repo_name": "matiasg11/CodeWarsSolutions", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "7kyu/sorted.js", "max_forks_repo_name": "matiasg11/CodeWarsSolutions", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.0625, "max_line_length": 167, "alphanum_fraction": 0.654676259}
/*Finish the solution so that it sorts the passed in array of numbers. If the function passes in an empty array or null/nil value then it should return an empty array.

For example:

solution([1, 2, 10, 50, 5]); // should return [1,2,5,10,50]
solution(null); // should return []*/

function solution(nums){
  if (nums == null){
    return []
  } else {
    let result = nums.sort((a,b)=> a-b)
    return result
  }
}
