acdoyle630 / js-functions-1

Javascript Function Exercises
0 stars 0 forks source link

You can return expressions #2

Open theRemix opened 7 years ago

theRemix commented 7 years ago

for example in https://github.com/acdoyle630/js-functions-1/blob/master/functions.js#L118

        if (x > y) {
        return true;
    } else {
        return false;
    }

x > y is an expression that evaluates to a boolean value. true or false

you can return this expression (while omitting if, else blocks)

theRemix commented 7 years ago

if you do this, also refactor the others where you can also return an expression