+ 4
What does return without any value mean in javascript?
I always see a code like this but don't what the return statement is doing from here function checkFileSize() { var FS = document.getElementById("FS"); var files = FS.files; // If there is (at least) one file selected if (files.length > 0) { if (files[0].size > 75 * 1024) { // Check the constraint FS.setCustomValidity("The selected file must not be larger than 75 kB"); return; } } // No custom constraint violation FS.setCustomValidity(""); }
5 Answers
+ 4
means quiting the function
+ 7
Only returns the program flow/counter to the point just after function invocation.
+ 4
Means return nothing....
+ 1
Without value, wouldn't that mean 'undefined'?