Merge pull request #1710 from mdizo/master

Function return example update
This commit is contained in:
Ilya Kantor 2020-01-16 18:09:51 +01:00 committed by GitHub
commit 00d10515e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -266,7 +266,7 @@ There may be many occurrences of `return` in a single function. For instance:
```js run ```js run
function checkAge(age) { function checkAge(age) {
if (age > 18) { if (age >= 18) {
*!* *!*
return true; return true;
*/!* */!*
@ -277,7 +277,7 @@ function checkAge(age) {
} }
} }
let age = prompt('How old are you?', 18); let ageCheck = prompt('How old are you?', 18);
if ( checkAge(age) ) { if ( checkAge(age) ) {
alert( 'Access granted' ); alert( 'Access granted' );