HTML Hacks

Below is a singular button, with Button as the text. This is written in a paragraph tag. This paragraph and the button below are both in div 1.

This is link to google This is link to youtube

This is another paragraph tag. Both links and this paragraph are in div 2.

JavaScript Hacks

%%js

obj = {
    name: "Matthew",
    age: 17,
    classes: ["CSA", "World Lit", "Stats", "Civics", "Psych"],
    interests: ["Badminton", "Programming", "Gaming"],
    driverslicense: false, 
    glasses: true,
    highschoolyearscompleted: 3         
}

console.log(obj)
console.log("My name is " + obj["name"])
obj["name"] = "Matthew Wang"
console.log("My full name is " + obj["name"])
console.log("It is a " + typeof obj["name"])
console.log("glasses is a " + typeof obj["glasses"])
console.log("age is a " + typeof obj["age"])
var yearsoutsidehighscool = obj["age"]-obj["highschoolyearscompleted"]
console.log("I have spent " + yearsoutsidehighscool + " years outside of high school")



<IPython.core.display.Javascript object>
{
  name: 'Matthew',
  age: 17,
  classes: [ 'CSA', 'World Lit', 'Stats', 'Civics', 'Psych' ],
  interests: [ 'Badminton', 'Programming', 'Gaming' ],
  driverslicense: false,
  glasses: true,
  highschoolyearscompleted: 3
}
My name is Matthew
My full name is Matthew Wang
It is a string
glasses is a boolean
age is a number
I have spent 14 years outside of high school

Below is a singular button, with Button as the text. This is written in a paragraph tag. This paragraph and the button below are both in div 1.

This is link to google This is link to youtube

This is another paragraph tag. Both links and this paragraph are in div 2.

More JavaScript hacks

let a = 10;
let b = 20;

if (a > b) {
    console.log("a is greater");
} else if (b > a) {
    console.log("b is greater");
} else {
    console.log("both are equal");
}

<IPython.core.display.Javascript object>

b is greater

let x = 10;
let y = 5;

let addition = x + y;
let subtraction = x - y;
let multiplication = x * y;
let division = x / y;


let modulo = x % y;         
let exponent = x ** y;      

console.log("Addition: " + addition);          
console.log("Subtraction: " + subtraction);    
console.log("Multiplication: " + multiplication); 
console.log("Division: " + division);         
console.log("Modulo: " + modulo);              
console.log("Exponent: " + exponent);         

Addition: 15
Subtraction: 5
Multiplication: 50
Division: 2
Modulo: 0
Exponent: 100000