Answer:
No
Step-by-step explanation:
Every time you finish a function you should test it with a wide variety of inputs, trying to cover as many logical cases as possible; if you skip this step you could end thinking that your code is correct because it performs well in one test when it is not, that is exactly the case for this code, to understand why you can test it with these inputs:
- What happens when you pass a no numerical input: Because the code doesn't have any input check it will crash when performing mathematical operations with strings, arrays, booleans ...
- What happens when you use makeNumsList(4, 7): Because on line 4 you are assigning 1 to num the result of this input will be [1,2,3,4] when it should be [4,5,6,7]. One way to solve the problem is to assign start to num
- What happens when 'start' is greater than 'end': You need to decide what do you want your code to do in this case
- What happens if you pass negative values: Again you need to decide what do you want your code to do in this case
In conclusion, you don't have control over what the user is going to input. For this reason, you should test every logical case and make changes to your code accordingly to the results.