Introduction to Modern JavaScript

alvinimbua

Alvinimbua

Posted on February 14, 2022

Introduction to Modern JavaScript

JavaScript(JS) is an interpreted compiled language with first class functions and it is a scripting language. It is an object oriented language. It is very different from java language in terms of the syntax, and its uses. JavaScript allows one to write code that runs inside the web browser on the client side. It makes the web pages to be more interactive. JavaScript give the ability to directly manipulate the DOM (Document Object Model) which is a tree like hierarchy that represents the web page the user happens to be looking at.

To add Java script into a web page, you only have to include the script tags as shown below.

<script>

</script>
Enter fullscreen mode Exit fullscreen mode

Using this script tags, we are literally telling the browser , that anything between the script tags should be interpreted as JavaScript code that the web browser is going to execute.
An example of how it works:

<script>
alert('Hello, Lux Academy!');
</script>
Enter fullscreen mode Exit fullscreen mode

On the above example the, alert word is a function and inside the function, there is an argument which is passed and n this case it is the "Hello, Lux Academy". It is important to note that one can use either double quotes or single quotes to denote the use of strings in JavaScript.

JavaScript has a various features such as Events, Arrow Functions,Query Selector, JavaScript console, DOM and TODO list, just but to mention a few. JavaScript as one of the feature is explained more below.

JavaScript Console.
It is a useful tool for testing out small chunks of code and debugging. One can write and run JavaScript code in the console and can be found by inspecting your web browser and then clicking console. To use it,one just has to write the following:

console.log(arguments are passed here);

There is much more on JavaScript and to learn more on JavaScript one can visit the Mozilla web docs (MDN Web Docs).

💖 💪 🙅 🚩
alvinimbua
Alvinimbua

Posted on February 14, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related