ref
#
This keyword allows passing a variable by reference even though it would normally be passed as a copy (i.e. by value).
For the reduceEnergy()
function that we saw earlier, to modify the original variable, it must take its parameter as ref
:
Get hands-on with 1400+ tech skills courses.