JavaScript (JS) fulfilled a great need for websites to be dynamic, and interactive. In fact JS is so interactive that you can play complex games in the browser all coded in it. JS is a dynamic programming language that was invented by Brendan Eich of the Mozilla Foundation in 1995. Did you know that JS is managed by committees that consist of several companies which are actually rivals but work together to help improve the language? Imagine being that powerful! A few of the main features of JS are:
<script> </script>
tag inside the <head> </head>
of an HTML5 document "onClick"
<script src="app.js"> </script>
function add(a, b) {
return a + b;
}
addEventListener()
as follows: const nextButton = document.querySelector("#next-btn");
nextButton.addEventListener("click", function validateInput() { }
userPromise.then( () => {
// task to do
});
userPromise.then( () => {
// task to do on success
}).catch( () => {
//task to do on failure
});
We have just brushed over very few important topics in JavaScript. JS is a vast language that requires whole books to really understand it, such as the around 500 pages long "Eloquent JavaScript: A Modern Introduction to Programming"!