DEV Community

Akshat Sharma
Akshat Sharma

Posted on

Day 1 of 30 of JavaScript

Hey folks :) I hope you are doing fine. In this 30 days of JavaScript we are going to learn all about JavaScript from beginner to gradually going to advancement. I'll be sharing my knowledge in simple and understandable way. So let's get started ...

But hey don't get confused with Java and JavaScript they both are much different languages. Now we are good to go.

Image description

JavaScript is one of the most important and popular programming language. It has many areas of application. It is used everywhere from web development to blockchain. Also it is an easy language to learn.

JavaScript was invented by Brendan Eich in 1995.

What is JavaScript?

JavaScript is a cross-platform, object-oriented programming language used by developers to make web pages interactive.
Imagine a website as a house. HTML gives it structure like walls, doors, and windows, while CSS makes it look nice with paint and decorations. JavaScript is like the electricity that powers everything inside.
In simple words, JavaScript is the language that makes websites do cool stuff, making them more than just static pages but interactive experiences for users.

Features of JavaScript

  1. JavaScript is a structured programming language.

  2. It is a light-weighted and interpreted language.

  3. It is a case-sensitive language.

  4. JavaScript is an object-oriented programming language that uses
    prototypes rather than using classes for inheritance.

  5. JavaScript is supportable in several operating systems
    including, Windows, macOS, etc.

Application of JavaScript

JavaScript has wide area of application.

  • Web Development -: JS allows developers to create a dynamic and interactive web page to interact with visitors and execute complex actions. Some famous websites built by the use of JavaScript are Google, YouTube, Facebook etc.

  • Web Application -: Various JavaScript frameworks are used for developing and building robust web applications.Netflix and PayPal were developed with AngularJS JavaScript framework and Application Programming Interfaces (APIs).

  • Server Applications -:JavaScript is also used to write server-side software through Node.js open-source runtime environment.Top companies like Walmart, PayPal, Uber, GoDaddy, and many more have adopted Node.js for server infrastructure.

  • Web Servers -: Node.js allows developers to use JavaScript to create a web server.

But this is not it there are many more applications of JavaScript.

How to use JavaScript in Webpage?

So there are two ways to use JavaScript in webpage.

  1. The <script> Tag -> In HTML, JavaScript code is inserted between <script> and </script> tags.

Example ->
<script>
console.log("Hello world")
</script>

Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both. But I'll say place it in the last in <body> as placing script in starting will slow your website as initially all the script will load first , so it is better we place it in end.

  1. Using external JavaScript -> It is a better approach to define the complete JavaScript code in another file as it will give simplicity and good structure to whole of your code. This is how it can be done -: <script src="script.js"></script>

The script will behave as if it was located exactly where the <script> tag is located.

So this is it for this tutorial. In the next post we will be learning about how outputs are displayed in JavaScript. Till then stay connected and don't forget to follow me.

Top comments (5)

Collapse
 
morphzg profile image
MorphZG

Thanks for sharing. You could make it a series so all 30 posts will be linked. Like a "playlist"

Collapse
 
sahirpunjwani profile image
Sahir Punjwani

yes

Collapse
 
hbetabessi profile image
Hajer Betabessi

nice !

Collapse
 
amandeep8130 profile image
Amandeep Singh

Nice post. Thanks for sharing

Collapse
 
sahirpunjwani profile image
Sahir Punjwani

nice !