Skip to content

Repository files navigation

JavaScript Basics 1 - Variables, Functions, and Branching

Step 1 : Variables

  1. Define a variable, "name"
  2. Show this variable in an alert box
  3. Commit

Step 2 :

  1. Define three variables: name, surname and city.
  2. Show them like in the image
  3. Commit!

Step 3 : Strings concatenation

  1. Show a dialog box asking the user for his name
  2. Show an alert box saying "Hello, ", then the name provided
  3. Commit!

Step 4 :

  1. Just like Step 3, but ask for name, surname, and city (Step 2 + Step 3)
  2. Commit

Step 5 : Simple Math

  1. Ask for the user for two numbers
  2. Multiply them
  3. Show the result to the user
  4. Commit

Step 6 : External files and Simple Math

  1. Create a separate javascript file
  2. Include it in the html
  3. Have the user provide two numbers
  4. Divide them
  5. Show the user the remainder of the division
  6. Commit

Step 7 : Multiple operations

  1. In an external file:
  2. Ask the user for his show size and his birth year
  3. Create a function that:
  4. Multiplies the shoe size by 2
  5. Adds 5
  6. Multiplies by 50
  7. Subtracts the birth year
  8. Adds 1766
  9. Shows the result to the user
  10. Commit

Step 8 : if, else

  1. Ask the user for their age
  2. If the user is over 18, show "you are over 18", else, show them "you are under 18"
  3. Commit

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages