//This is a line comment let a = 10; prn("a: " + a); /*this is a a block comment and can go on multiple lines*/ a = 20; prn("a: " + a);
let myNum1, myNum2, myString1, myString2, myString3, myBoolean1, myBoolean2; //common number usage includes integers and floats myNum1 = 5; myNum2 = 10.99; //strings myString1 = 'we can use single quotes'; myString2 = "we can use double quotes"; myString3 = `or backticks (used for formatting)`; //booleans (either true or false) myBoolean1 = true; myBoolean1 = false;
let firstName, lastName, fullName; firstName = 'Kofi'; lastName = 'Kingston'; //We add a space ' ' between the names fullName = firstName + ' ' + lastName; prn(fullName);
let a, b, c, sum, diff, product, quotient;
a = 10;
b = 2;
sum = a + b;
diff = a - b;
product = a * b;
quotient = a / b;
let a, b, remainder;
a = 5;
b = 3;
remainder = a % b;
prn("5/3 remainder (expecting 2): " + remainder);
//This is a line comment let count; count = 10; prn('count (before): ' + count); count++; prn('count (after "++"): ' + count); count--; prn('count (after "--"): ' + count);
//This is a line comment let n1, n2, s1, s2, isEqual, isNotEqual; n1 = 101; n2 = 100 + 1; //isEqual will be a boolean here (true/false) isEqual = n1 === n2; prn("isEqual (expecting true): " + isEqual); s1 = 'foo'; s2 = 'oops'; //isEqual will be a boolean here (true or false) isEqual = s1 === 22; prn("isEqual (expecting false): " + isEqual); s1 = 'foo'; s2 = 'oops'; isNotEqual = s1 !== 22; prn("isNotEqual (expecting true): " + isNotEqual);