GithubHelp home page GithubHelp logo

assignment-unit-2.2's Introduction

Unit 2, Part 2: Describing Code

This week we introduced the programming language of the Internet, JavaScript. With JavaScript we can make our websites smart by adding interactivity and logic.

Topics Covered

  • Variables and Constants
  • Conditional statements

Assignment

As always, start off by forking and cloning this repository from GitHub. Open the code up in Atom to get started.

Note that in the future we will not call this out explicitly. We'll assume you already know that is how you start your work.

Files Provided

  • describe.js (Required Features)

The describe.js file contains prompts for comments and code. It is for practicing explaining code without running it to see what happens. There is no HTML file provided to source in and trigger the JavaScript file to run.

Instructions

Add comments as instructed into the describe.js file.

The file is broken into two sections:

  • The first section has you describe written code blocks in your own words.
  • In the second section, there is a description of how the code should work, but the code has an issue or "bug" in it for you to find.

Section 1
For questions 1-3, you will narrate what the code is doing. The code here is correct. Just describe in your own words what the code is doing. Pretend it is running in the browser and you need to describe each line as it would run. NOTE: Not all lines WOULD run based on the conditional logic.

Example:

// 0. WRITE YOUR DESCRIPTION HERE
// We make a variable called number and set it to 1 as a number.
// Then we increment the number variable. Number is now 2.
// We check if number is greater than or equal to 2. 2 is equal to 2, so
// we console.log 'yes'.

//CODE
/*
let number = 1;

number++;

if (number >= 2) {
  console.log('yes');
}

Section 2
For questions 4-6, you are given a description of how the code should behave. The code given will have something logically incorrect, and your job is to find the issue and make a comment describing what is wrong and how to fix it.

Example:

// 0. (DESCRIPTION OF CORRECT BEHAVIOR)
// We make a variable called number and set it to 1 as a number.
// Then we increment the number variable. Number is now 2.
// We check if number is greater than or equal to 2. 
// -- it is, so we console.log 'yes'

//CODE
/*
let number = 1;

number--; 
// FIX - number-- decrements number, but the instructions ask to increment. 
// Should be number++

if (number >= 2) {
  console.log('yes');
}

*/

Assignment Submission

Check in your repo, then turn in your work via the Prime Academy Assignment Portal, as usual and don't hesitate to hit up the Slack channel as needed!

REMINDER: Make sure to answer the Slack discussion question!

assignment-unit-2.2's People

Contributors

mbmosman avatar hafsamhussein avatar kdszafranski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.