Week 2 Lab - CI256

Week 2 Lab

Description of Lab

You’ll be solving a set of programming questions in Javascript.

The goal tonight is to get familiar with the language and tools.

Lab Objectives

Your objective is to fill out the functions that are partially defined in the lab2.js file and submit it to Brightspace.

The requirements of each function are docuented as a comment above the function. The problem description is also available on https://lab.ci256.cloud.

Setting up the lab

Note: Clone to your desktop higher speeds, your H drive will be slow to run code from.

  1. Install Git if you don’t already have it: https://git-scm.com/downloads
    • The Lab machines will already have it installed as “Git Bash”, if you search the start menu
    • We’ll also be using git later in this course
  2. Get the lab files by running the command: git clone https://gitlab.com/rudedog9d/ci256.git
  3. Open VSCode in the new directory with the command: code ci256
  4. Change directory into the lab files with the command: cd ci256/week2_javascript_intro

Installing VSCode Extensions

When opening the CI256 folder in VSCode, you should see a popup like the image below.

I’ve added some recommend extensions, which will automatically be installed if you click the install button.

Running Lab Online

You can test your Lab code online at https://lab.ci256.cloud/!

You may edit code locally and copy-paste, or edit the code directly in the browser.

Make sure you still save the code to a local file and submit your assignment to Brightspace!

Running the Lab Locally

First, install require dependencies

npm install

Run a specific function in your code

npm run func question1 5 10

Run a specific test suite

npm run test -- -t 'Question 9'