So I just found the “proper” solution to this lab, but up until I remembered the rest operator existed I was wrapping my brain into knots trying to find a roundabout solution and came up with something. I believe it fulfills the requirements of the tests, yet it fails all of them. I would like to know why this solution in particular does not pass.
yes, that returns the following:
[ 4, 1, 2, 3, 5 ]
which is the correct output, but it is not passing the lab. i tried comparing both this function and the proper solution with various test cases in vscode, and both are giving me the same results, so I’m not sure why this particular solution doesn’t work/isn’t accepted.
oooh i see the problem now! i forgot a keyword (i keep forgetting keywords like this i thought i wouldve learned by now lol), when i added it back in it accepts the solution just fine. i should keep closer attention to the console going forward. thank you for the help!