Variables

Last updated 4 months ago

Variables are like "boxes" that stock a value.

Variables and values

In JavaScript, you don't have to specify what type of value you want to store, you just have to declare it :

var aString = "Hello !";
console.log(aString);

console is an object, we will see this later. console.log let's you print on the console a variable or a value.

Here, our program should output : Hello !

Create a new folder and a new js file in it, and try to compile and run it with NectarJS :

nectar myfile.js --run