Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

When you write code, you'll want to create shortcuts to data values so you can don't have to write out the same value every time.

We can use variable to create a reference to a value.

var greeting = "Hello world";

console.log(greeting);

The program above will print "Hello world" to the console. Notice how it uses the value assigned to the variable greeting.

Exercise

  • Add a variable greeting to exercise.js (make sure it comes before the console.log)
  • Print your greeting to the console 3 times

Remember: to run this exercise you must change directory to the C-variables. If you already have a terminal window open for the previous exercise you can do this by running the command cd ../C-variables.

Expected result

Hello world
Hello world
Hello world