Code Monkey home page Code Monkey logo

flw1-u1l4-23-24-student-exercises's Introduction

Lesson 1.4: Conditionals & Project Intro

Table of Contents

  1. Conditionals
  2. Compound Conditionals
  3. Asking Technical Questions
  4. Professional Portfolios

Conditionals ๐Ÿ”„

Conditionals allow you to execute different code based on conditions.

Basic syntax:

if (condition) {
   // code to execute if condition is true
} else {
   // code to execute if condition is false
}

Example:

if (age > 16) {
   console.log("You can drive!");
} else {
   console.log("Sorry. Too young!");
}

Comparison Operators:

  • < : less than
  • > : greater than
  • <=: less than or equal to
  • >=: greater than or equal to
  • ===: equal to
  • !==: NOT equal to

Remember: Conditions should evaluate to either truthy or falsy.

Compound Conditionals ๐Ÿ”„๐Ÿ”„

These allow you to check multiple conditions.

Logical Operators:

  • ! : NOT
  • || : OR
  • && : AND

Example with the AND operator:

if (sky === "clear" && temp === "warm") {
   alert("Wonderful! Go enjoy the weather!");
} else {
   alert("Hmm. Consider staying home today.");
}

Asking Technical Questions โ“

When seeking help or discussing your code:

  1. Provide context.
  2. State the coding language you're using.
  3. Share your code or screen.
  4. Explain the current behavior vs. expected behavior.
  5. Share any attempts you've made to solve the issue.

Example: "On line 3 of my JS file, this function is returning undefined, but I want it to return the sum. Do you spot any errors?"

Professional Portfolios ๐Ÿ–ผ๏ธ

What's a portfolio?

  • A collection of work samples.
  • Shows off your skills and achievements.
  • Useful for job opportunities or sharing your work.

Key Features:

  • Multiple HTML pages.
  • Professional information about yourself.
  • Links to past coding projects.
  • CSS styling that matches your personality.

Key Takeaways

  • JavaScript conditionals allow for decision-making in code.
  • Compound conditionals help evaluate multiple conditions.
  • Properly communicating about your code is essential for collaboration and debugging.
  • A professional portfolio is a great tool for showcasing your skills and projects.

Remember, always refer back to this README if you need a refresher on today's topics.

Keep practicing and happy coding! ๐Ÿš€

flw1-u1l4-23-24-student-exercises's People

Contributors

cn-curriculum avatar cn-marcus avatar cn-mika avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.