Fundamentals Part 2

Introduction

There are a few extremely common types of data that you will encounter in Javascript, and these fundamentals lessons will give us a really strong foundation in all of them. Before we start digging deep, however, this article will give you a quick overview of the most common ones.

Learning Outcomes

Look through these now and then use them to test yourself after doing the assignment:

  • What are the seven data types of javascript?
  • Which data type is NOT primitive?
  • What is the difference between single, double, and backtick quotes for strings?
  • Which type of quote lets you embed variables/expressions into a string?
  • How do you embed variables/expressions into a string?
  • How do you escape characters in a string?
  • What is the difference between slice/substring/substr?
  • What are methods?
  • What are the three logical operators and what do they stand for?
  • What are the comparison operators?
  • What is nesting?
  • What are truthy and falsy values?
  • What are the falsy values in Javascript?
  • What is the syntax for an if/else if/else conditional?
  • What is the syntax for a switch statement?
  • What is the syntax for a ternary operator?
  • What is the relationship between null and undefined?
  • What are conditionals?

Strings

Depending on what kind of work you’re doing, you might end up working more with pieces of text rather than numbers. A string is simply a piece of text… and is a fundamental building block of the language.

  1. Read and code along with yet another MDN tutorial on the topic.
  2. Go through this lesson to learn a bit more about what you can do with strings… be sure to do the exercises at the end!
  3. Vocabulary time: a method is a bit of functionality that is built into the language or into specific data types. In the previous W3Schools exercise, you learned a few methods that can be used on strings, such as indexOf and search. An exhaustive list of methods that can be used on strings can be found here.

Conditionals

Now it’s time for the fun stuff… So far we haven’t done much with our programming that you couldn’t do with simple math skills. Sure, we’ve told our computer how to do the math, so that makes it quicker, but the essence of programming is teaching the computer how to make decisions in order to do more involved things. Conditionals are how we do that.

  1. Step one in learning about conditionals is making sure you have a good grasp on comparisons and logical operators.
  2. This tutorial is a great first glance at conditionals in JavaScript.
  3. This article reinforces the concept and provides several interesting examples of how you could use it building websites.
  4. This article covers the same basic concept (read through it as a review!) And more importantly offers the usual ‘tasks’ at the bottom of the page!
  5. This tutorial teaches you about the switch statement, which comes in handy when you have multiple conditions.

Practice

To give you a good bit of practice, we have created an online classroom on repl.it. In general, we believe that it’s best to practice programming on your own computer rather than in an online environment, but we’ll get to that soon enough.

  • The classroom and lessons can be found here. Sign up or login to repl.it to see the lessons, and be sure to do the lessons in order. You can submit your answers to check them, and a couple of the lessons include ‘model solutions’.

Additional Resources

This section contains helpful links to other content. It isn’t required, so consider it supplemental for if you need to dive deeper into something.

Web Development 101

Fundamentals Part 2

Have a question?

Chat with our friendly Odin community in our Discord chatrooms!

Open Discord

Are you interested in accelerating your web development learning experience?

Get started

Thinkful

  • 5-6 months

    5-6 months

  • Job Guarantee

    Job Guarantee

  • 1-on-1 Mentorship

    1-on-1 Mentorship