JS-100-PreWork
  • Introduction
  • JavaScript Library
    • 0-PreWork
      • 1-Getting Started
        • Installs
        • Directory Set up
        • Configuration
      • 2-HTML Basics
        • Basic Tags
        • h & p
        • list
        • link
        • img
        • table
        • div
        • input
        • form
        • section
        • article & header
        • footer
        • nav
        • iframe
      • 3-CSS Basics
        • CSS Set Up
        • class
        • id
        • margin & padding
        • font
        • background
        • width & height
        • borders
        • position
      • 4-JS Basics
        • JS Set up
        • numbers
        • variables
        • strings
        • booleans
        • conditionals
        • functions
        • loops
        • arrays
        • objects
Powered by GitBook
On this page
  • File Location
  • Node Exec
  • Running the Code
  • Self-Assessment
  1. JavaScript Library
  2. 0-PreWork
  3. 4-JS Basics

JS Set up

Previous4-JS BasicsNextnumbers

Last updated 7 years ago

It takes some work to get to the point where you can use JavaScript to manipulate the DOM. With JavaScript we can take data from a form and send it to a server, create all kinds of interesting effects and animations, and organize data in new and interesting ways.

For learning purposes, we will be working in a simple console window for these lessons, and we will not synthesize HTML, CSS, and JavaScript until Week 2 of the program. Then, we'll do more work with JavaScript in an application. Before we do that, we've got to make sure you have a solid foundation in JavaScript fundamentals.

File Location

You should be working in the following file:

   javascript-library
        └── 0-PreWork
            └── 1-HTML-Basics
            └── 2-CSS-Basics
            └── 3-JavaScript-Basics
                00-setup.js       <---Work here.

Node Exec

If you are jumping in here and haven't installed Node Exec yet, you'll want to grab it that package that will help us run JavaScript in a console window in Visual Studio code. Here are the instructions for doing that:

  1. Click on the Extensions button.

  2. Search for Node Exec.

  3. Install the package.

  4. Inside of setup.js, on line 1, write the following statement:

    console.log('Hello world!');
  5. Still inside of the file, press F8 or hold the fn key and press F8.

  6. The code should execute, and you should see the following:

Running the Code

  1. Press the debug button or ctrl + shift + d.

  2. Press the play button in the top left.

  3. If everything goes right, you should have a console window pop up.

Self-Assessment

In this file go ahead and write out whatever you might know about JavaScript.

  • Can you write a function?

  • A for loop?

  • Can you write FizzBuzz?

  • If you can't do any of these things, leave this file blank. This is intended to be used for your personal growth.

Set up Test