Skip to content

Jocode23/flw1-u1l4-23-24-student-exercises

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 82.6%
  • HTML 17.4%