p1 is a function parameter, and as such gets the value assigned to it by a variable. This value can be a reference (quick) or a copy (slow), if you do not change the variable inside of the function it (e.g. only read from it) than the parameter will stay a reference, which is quick and memory efficient. If p1 is updated in the function, then the variable that gave the value is not changed (pass-by-promise), but a copy is created as soon as you overwrite the function parameter (slow and duplicates memory). Hope this helps.
The Slide in German or Slide in Dutch is just for entertainment, viewers can request it as a reward for watching. I also do the slide in English to make sure everyone understands... I don't think my German is that bad :)
Thank you Prof. Nice content.
Glad you like it, thanks for leaving a comment
At 46 mins of the video, why is there a need to write myvar
p1 is a function parameter, and as such gets the value assigned to it by a variable. This value can be a reference (quick) or a copy (slow), if you do not change the variable inside of the function it (e.g. only read from it) than the parameter will stay a reference, which is quick and memory efficient.
If p1 is updated in the function, then the variable that gave the value is not changed (pass-by-promise), but a copy is created as soon as you overwrite the function parameter (slow and duplicates memory).
Hope this helps.
Pls speak English.
The Slide in German or Slide in Dutch is just for entertainment, viewers can request it as a reward for watching. I also do the slide in English to make sure everyone understands... I don't think my German is that bad :)