Why bother with the return of a variable that never gets document.write? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why bother with the return of a variable that never gets document.write?

9th Oct 2015, 5:32 AM
aaron urban
aaron urban - avatar
2 Answers
0
Because you may want to do more with a variable than write it to the screen.
23rd Nov 2015, 12:22 PM
Brendon Williams
Brendon Williams - avatar
0
I'm not the first to say it, but it's worth repeating: You can do many things other than send what's RETURNed to document.write() or such. Imagine if you had a sweet, streamlined function that checked pre-set boundaries. You could call your boundary-checking function with the parameter of an object and receive a RETURN boolean whether the object is in-bounds or not. This is just an example -- you can Call & Return Functions anyway you desire.
13th Jan 2016, 2:17 PM
KL Brey
KL Brey - avatar