Variables

by Abid Akhtar

HTML

<h1></h1>

JavaScript

const myHeading = document.querySelector('h1');
myHeading.textContent = 'Hello World!';
/* This to assign a variable */
let myVariable = 'Bob';
let myNumber = 5;
// This is also a comment 
console.log( 6 + 9);
// Concatenation
console.log( 'Hello'+ 9);
// Assignment 
let isNumber = myNumber !== 'Abid';
console.log(isNumber);
console.log(myVariable);
/*let iceCream = 'Chocolate';

if(iceCream === 'Chocolate')
{
   alert('Yay ,I love chocolate ice cream!');
}
else
{
 alert('Awww ,but Chocolate is my Favorite');
}*/