Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Loops not Expressions#

Sumit Rawal answered on May 23, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Loops with for expressions

  • Loops not Expressions#

    0

    You might have noticed that we have been using the term while loop instead of while expression. This is contradictory to the term if expression we have been using throughout the several previous lessons. So, why is it that we haven’t been calling while and do-while expressions.

    This is because expressions have return values and while and do-while don’t result in any significant return value. Both loops have a return type of unit which, as mentioned in an earlier chapter, is just a void value; empty.

    While pure functional programming languages have expressions and not loops, Scala still gives you the option of using while and do-while for imperative programming. However, like var, it is preferable for one to challenge themselves to not use while loops.

    Popularity 1/10 Helpfulness 1/10 Language javascript
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on May 23 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.