Add & Sort

Easy
168
3
80.8% Acceptance

Max was learning JavaScript, he attempted to create a one-liner function that would add a number to a given array and return the sorted array eliminating the need to do this continuously when required. However, he seems to have hit a roadblock with the code he has written, it isn't performing as expected.

Can you help him in debugging his code? You have to find the root cause of the problem and update the function logic to work as expected.