WDI Fundamentals

WDI Fundamentals Unit 8


By the end of this unit, you'll be able to:
  • Practice programmatic thinking by writing pseudocode.
  • Perform arithmetic and logical operations on data to produce new values.
  • Concatenate two strings together using JavaScript.
  • Write expressions that both assign and evaluate variables.
  • Explain what "null" is and (generally) how it works.
  • Recognize the difference between "truthy" and "falsey" values.

JavaScript

It's time for us to move on to the main event: programming. Now, we'll add some functionality to our memory game! It's worth mentioning that, although most people think that programming is all about writing code, it's really much more about solving problems. Problems such as:

  • "How many students are here today?"
  • "How far away am I from the restaurant?"
  • "What's the fastest way to find the file I'm looking for?"

As a developer, trying to "just start coding" without first identifying the problem at hand is a surefire way to waste time, frustrate yourself, and create suboptimal products. However, in order to understand how to solve a problem, you first need to understand the tools at your disposal.

Throughout this chapter, we'll be exploring some of the more common tools and concepts available to programmers. Although we will be specifically looking at these concepts in the context of JavaScript, these tools (or similar ones) are present in nearly every modern programming language. Having a strong understanding of the basics is essential and will translate to your future work, whether you end up programming in JavaScript, Ruby, Python, or any other language.


JS Bin

To start playing around with JavaScript, we'll be using a website called JS Bin.

JSBin Screenshot

As you can see in the screenshot above, JS Bin features different window panes. On the right, with the light background, is the preview pane, which displays what your code builds in real time. It automatically updates with any change, unless you uncheck the "Auto-run JS" option in the upper right-hand corner of this section. On the left, with the dark background, is the editor. The editor allows us to write several instructions for our computer using HTML, CSS, and JavaScript. To execute these instructions, click the "Run with JS" button in the right window.

To save your JS Bin session, just "Login" or "Register" at the top, and log in with GitHub. When you select "File," followed by "New," you'll open a blank workspace. The moment you begin writing code, JS Bin will generate a URL that you can bookmark and come back to at any time.

JS Bin has the ability to show a "Console," displaying any JavaScript code you need to run. You will need to use this feature from time to time. You can hide or display any tabs (HTML, CSS, JavaScript, or console) as needed.

Ready to begin? Let's go.