DEV Community

benboorstein
benboorstein

Posted on • Edited on

Quick Notes Based On "Control Flow" Section of Frontend Masters' "Complete Intro to Web Development, v2"

What I did (in code):

    const tempToday = 86

    if (tempToday < 55) {
       console.log('Make it warmer, please!')
    } else if (tempToday <= 100) {
       console.log('Yes, this is in my happy temperature range!')
    } else {
       console.log('I like it hot, but this may actually be TOO hot!')
    }

    Logs: Yes, this is in my happy temperature range!

What I did (in English):

  • If the value stored in tempToday is less than 55, then log 'Make it warmer, please!'
  • Otherwise, if the value stored in tempToday is less than or equal to 100, then log 'Yes, this is in my happy temperature range!'
  • Otherwise (i.e., if the value stored in tempToday is greater than 100), then log 'I like it hot, but this may actually be TOO hot!'
  • Note that the reason, as far as I understand it, that there's not a conflict/confusion in the program between the first condition and the second condition is because the first condition is evaluated first, and only if the first condition doesn't apply (i.e., doesn't evaluate to true) will the second condition be evaluated.

What I practiced:

  • Same as above.

What I learned:

  • From the above code, I didn't learn anything new.
  • From other parts of this section of instruction, I learned that there's a VS Code extension called "Prettier" that inserts semicolons right where they should be. I suppose this is useful if you have gotten in the habit of leaving them out (as is the case with me, as you can see) but you work in an environment in which they're preferred.

What I still might not understand:

  • Nothing for this section.

ACI image

ACI.dev: The Only MCP Server Your AI Agents Need

ACI.dev’s open-source tool-use platform and Unified MCP Server turns 600+ functions into two simple MCP tools on one server—search and execute. Comes with multi-tenant auth and natural-language permission scopes. 100% open-source under Apache 2.0.

Star our GitHub!

Top comments (0)

Tiger Data image

🐯 🚀 Timescale is now TigerData: Building the Modern PostgreSQL for the Analytical and Agentic Era

We’ve quietly evolved from a time-series database into the modern PostgreSQL for today’s and tomorrow’s computing, built for performance, scale, and the agentic future.

So we’re changing our name: from Timescale to TigerData. Not to change who we are, but to reflect who we’ve become. TigerData is bold, fast, and built to power the next era of software.

Read more

👋 Kindness is contagious

Explore this insightful write-up, celebrated by our thriving DEV Community. Developers everywhere are invited to contribute and elevate our shared expertise.

A simple "thank you" can brighten someone’s day—leave your appreciation in the comments!

On DEV, knowledge-sharing fuels our progress and strengthens our community ties. Found this useful? A quick thank you to the author makes all the difference.

Okay