JavaScript 2022

Term 3 Wednesday

May - July 2022

This site will be updated live during the sessions

Week 1 Exercise 1

		
001/*
		
002	A multi line comment
		
003	can be written in this way
		
004*/
		
005
		
006
		
007// writes the string Hello World to the console
		
008console.log('Hello World');
		
009// console.log("More text to the console");
		
010let numResult, stringResult, booleanResult;
		
011
		
012// num1 declared and initialised with the value 20
		
013let num1 = 20;  
		
014
		
015// num2 declared and initialised with the value 5
		
016let num2 = 5; 
		
017 
		
018
		
019numResult = num1 + num2;
		
020console.log("The result of num1 + num2 is: " + numResult); // 25
		
021
		
022
		
023let isOverdrawn = true; // Boolean
		
024console.log(isOverdrawn);
		
025isOverdrawn = false; //Boolean
		
026let string1 = "true"; //string value
		
027let string2 = "13" // string value
		
028const pi = 3.14;
		
029// num1 value changed to 15
		
030num1 = 15;  //Number
		
031
		
032numResult = num1 + num2; // 20
		
033console.log("The result of num1 + num2 is: " + numResult); //20 logged
		
034num2 = "twenty";
		
035