Yahoo Clever wird am 4. Mai 2021 (Eastern Time, Zeitzone US-Ostküste) eingestellt. Ab dem 20. April 2021 (Eastern Time) ist die Website von Yahoo Clever nur noch im reinen Lesemodus verfügbar. Andere Yahoo Produkte oder Dienste oder Ihr Yahoo Account sind von diesen Änderungen nicht betroffen. Auf dieser Hilfeseite finden Sie weitere Informationen zur Einstellung von Yahoo Clever und dazu, wie Sie Ihre Daten herunterladen.
2 Antworten
- Newms34Lv 6vor 6 Jahren
As I said in the comment above, a function by default returns 'undefined', which for all intents and purposes is the same as returning false. So the return false here is essentially useless.
MORE:
Why is returning 'false' the same as returning 'undefined'? This has to do with the concept of 'truthiness' in JavaScript: certain values, when evaluated as 'yes' or 'no', will evaluate to true. For example:
0 = false
false = false (duh)
"false" = true (it's a string, so the browser thinks it exists, and therefore is true)
"any other string" = true
1 to infinity, or -1 to negative infinity = true
undefined = false
null = true (usually!)
So if a program were to use this return value to test something (i.e., if (!showpic(myObj)) alert('returned false!')), returning false would do the exact same thing as returning nothing (i.e., undefined).