true, there should be a test case for that
What about if null is passed?
clean solution.👍🏾
True, replacing nums with [...nums] would fix it if that is needed
nums
[...nums]
Be careful. This solution will change the initial array.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort "Note that the array is sorted in place, and no copy is made."
Thanks for the fix!
Typescript does not compile, unsure if it's the test or something else
The test doesn't check for '' If you set the greeting back to '', should it return 'Hello world!' or ''?
Loading collection data...
true, there should be a test case for that
What about if null is passed?
clean solution.👍🏾
True, replacing
nums
with[...nums]
would fix it if that is neededBe careful. This solution will change the initial array.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
"Note that the array is sorted in place, and no copy is made."
Thanks for the fix!
Typescript does not compile, unsure if it's the test or something else
The test doesn't check for ''
If you set the greeting back to '', should it return 'Hello world!' or ''?