Closed NikitaRevenco closed 6 months ago
While I like the idea, I don't think this is an appropriate or necessary change to make.
The task, as with any other exercise and functions in the calculator.js
file, are to complete the incomplete function in the file. Therefore, it's perfectly reasonable people won't even consider just assigning const power = Math.pow;
, because that would require effectively going against instructions and removing the empty function() { }
. Again, remember the point of the exercise is just to complete the tasks according to the spec however. I don't think changing (or even adding as an alternative) the solution to assigning Math.pow
provides substantial benefit. It's perfectly sufficient to call Math.pow
inside their own function. Some might even use **
instead of Math.pow
. Either is completely fine.
Functions passed as references will have been introduced in the Object basics lesson already, and is something people will come across plenty throughout the course. No need to provide what would seem a real left field solution for the sake of it.
While I like the idea, I don't think this is an appropriate or necessary change to make. The task, as with any other exercise and functions in the
calculator.js
file, are to complete the incomplete function in the file. Therefore, it's perfectly reasonable people won't even consider just assigningconst power = Math.pow;
, because that would require effectively going against instructions and removing the emptyfunction() { }
. Again, remember the point of the exercise is just to complete the tasks according to the spec however. I don't think changing (or even adding as an alternative) the solution to assigningMath.pow
provides substantial benefit. It's perfectly sufficient to callMath.pow
inside their own function. Some might even use**
instead ofMath.pow
. Either is completely fine.Functions passed as references will have been introduced in the Object basics lesson already, and is something people will come across plenty throughout the course. No need to provide what would seem a real left field solution for the sake of it.
Okay! Personally it took me a while to realise you can do manipulations like this with functions, despite knowing that they are passed by reference. But I do get where you are coming from!
I remember when I was at this stage I didn't ever think of something like this. For some reason I don't think many beginners will realise that this is possible to do with functions, so I think changing this little bit gives for a perfect example of how functions are passed by reference.