JavaScript JavaScript is a programming language that can be used to add interactivity to a website.
Some examples:
If statement: var iceCream = 'chocolate';
if (iceCream === 'chocolate') {
alert('Yay, I love chocolate ice cream!');
} else {
alert('Awwww, but chocolate is my favorite...');
}
Function definition: function multiply(num1,num2) {
var result = num1 * num2;
return result;
}
Event: document.querySelector('html').onclick = function() {
alert('Ouch! Stop poking me!');
}
Source: https://developer.mozilla.org/en-US/Learn/Getting_started_with_the_web/JavaScrip
t_basics