Coder Social home page Coder Social logo

javascript_variables's Introduction

title slug
Exercise: JS Introduction and Variables
/js-introduction-and-variables-exercise

Objective

Your objective is to begin using variables to store and pass values throughout your program.

To see your work, you can log, or print, the values stored in your variables to the console. Use console.log(variableName) to see your results in the browser console.

Exercise 1: Declaring Variables

Steps are to be completed in the app.js file.

  1. Declare a variable named firstName using the const keyword
  2. Declare a variable named lastName using the let keyword
  3. Declare a variable named age using the var keyword

Exercise 2: Assigning Values to Variables

Steps are to be completed in the app.js file.

  1. Assign your first name as the string value to the variable firstName
  2. Assign your last name as the string value to the variable lastName
  3. Assign your age as the number value to the variable age

Exercise 3: Declaring and Assigning Values to Variables

Steps are to be completed in the app.js file.

  1. Declare a variable named language using the let keyword, and assign it the value "JavaScript" (string)
  2. Declare a variable named createdYear using the let keyword, and assign it the value 1995 (number)
  3. Declare a variable named isCaseSensitive using the let keyword, and assign it the value true (boolean)

Exercise 4: Declaring and Assigning Values to Variables x2

Steps are to be completed in the app.js file.

  1. Declare a variable named price using the let keyword, and assign it the value 19.99 (number)
  2. Declare a variable named isOnSale using the let keyword, and assign it the value false (boolean)
  3. Declare a variable named salePercentage using the let keyword, and assign it the value 15 (number)
  4. Declare a variable named stock using the let keyword, and assign it the value 0 (number)
  5. Declare a variable named inStock using the let keyword, and assign it the value false (boolean)
  6. Declare a variable named selectedSize using the let keyword, and assign it the value "M" (string)

Exercise 5: Declaring and Assigning Values to Variables x3

Steps are to be completed in the app.js file.

  1. Declare a variable named title using the let keyword, and assign it the value "Name of the Wind" (string)
  2. Declare a variable named author using the let keyword, and assign it the value "Patrick Rothfuss" (string)
  3. Declare a variable named pageCount using the let keyword, and assign it the value 722 (number)
  4. Declare a variable named bookmark using the let keyword, and assign it the value 456 (number)
  5. Declare a variable named hasRead using the let keyword, and assign it the value true (boolean)

javascript_variables's People

Contributors

amoriss avatar bryantellius avatar mvdoyle avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

javascript_variables's Issues

README.md instructions differ from lesson instructions

The exercise instructions in README.md are different from the instructions listed on the lesson page.

Following the instructions in the README.md will cause one to create a syntax error (by declaring a const without assigning a value to it) and to leave out a few of the steps of the exercise.

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.