Comparison Operators & If Else - Beau teaches JavaScript

Поделиться
HTML-код
  • Опубликовано: 9 фев 2017
  • Learn about comparison operators. Also, if else statements!
    Code
    🔗 codepen.io/beau...
    Other resources on topic:
    🔗 developer.mozi...
    Beau Carnes on Twitter: / carnesbeau
    ⭐JavaScript Playlists⭐
    ▶JavaScript Basics: • JavaScript Basics Course
    ▶ES6: • ES6 - Beau teaches Jav...
    ▶Design Patterns: • Design Patterns - Beau...
    ▶Data Structures and Algorithms: • Data Structures and Al...
    ▶Clean Code: • Clean Code - Beau teac...
    -
    We're busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.
    Join our community at freecodecamp.com
    Follow us on twitter: / freecodecamp
    Like us on Facebook: / freecodecamp
    Follow Quincy on Quora: www.quora.com/...

Комментарии • 18

  • @AbhinavSharma_sylar
    @AbhinavSharma_sylar 7 лет назад +7

    You mentioned whenever we have an expression with an assignment to a number, inside the if condition, it is always going to evaluate to TRUE. but that is only if the assignment is for a non-zero number
    for ex:
    if (age = 1) will be, true
    if (age = 0) will be, false
    if (age = 0.0) will be, false

    • @motthebug
      @motthebug 7 лет назад +1

      Good point (tho' the point is that it means something different from asking if it's equal...)

  • @eeekkk34235
    @eeekkk34235 7 лет назад +5

    With the if...else statements failing on baby, another way other than swapping could be:
    if else (age > 2 && age < 18)
    console.log("You are a child");

  • @pilyglot3037
    @pilyglot3037 7 лет назад +3

    The alligator always eats the bigger number... it's greedy that way. (how I learned < and >)

  • @Allaboutdatps3
    @Allaboutdatps3 4 года назад

    Makes perfect sense, thanks.

  • @xortegaccaedu
    @xortegaccaedu 6 лет назад

    Please slowwwwww down. Love what you are doing.

  • @thomasgeorge4578
    @thomasgeorge4578 5 лет назад +2

    this so similar to python!

  • @pradeepchand8178
    @pradeepchand8178 6 лет назад +1

    how to solve a multiple if statement with in a single function
    example program is
    function testLessThan(val) {
    if (val < ) {
    return "Under 25";
    }
    else if (val < ) {
    return "Under 55";
    }
    return "55 or Over";
    }
    // Change this value to test
    testLessThan(10);

  • @hashtagtrends9886
    @hashtagtrends9886 4 года назад

    Thank You @t !

  • @farkhadmusazov7226
    @farkhadmusazov7226 2 года назад

    thank u

  • @Fichleai
    @Fichleai 7 лет назад +2

    What about === and !== ?

    • @BeauCarnes
      @BeauCarnes 7 лет назад +6

      Albin Metthey I have a "=== vs ==" video coming out soon but it may have been good to include those in this video.

    • @sasha_prisyazhnyy
      @sasha_prisyazhnyy 6 лет назад

      Mr. Carnes explicitly says in the very end of the video that this information is covered in later videos. I think the aim of the course is to give the information by small comprehensible bits to get the basic idea of the concepts.

  • @MylesGmail
    @MylesGmail 5 лет назад

    Thx!!!!!

  • @reaperforever8478
    @reaperforever8478 5 лет назад

    Which software is it ?

  • @aaronargottelopez3488
    @aaronargottelopez3488 4 года назад