Get Started With JAVASCRIPT

Hey there!, hope you all good. This is our first blog on JavaScript. In this blog lets see why you should prefer JavaScript over any other programming language? or You want to know how to get started or Even if you want to master it by building applications, games etc., then this is the right place for you. Here are few reasons why you should learn JavaScript in the first place.

Two Main Reasons Why You Should Learn JavaScript

Ranked 1 out of other programming languages

  • According to RedMonk, a developer-focused industry analyst firm, javascript is the number ONE programming Language used today.
  • RedMonk’s ranking were derived from an analysis of the programming traction on Github and StackOverflow.
  • In StackOverflow 2020 developer survey, Javascript is listed as the most popular language.

Inter-Disciplinary

  • JavaScript is used in Web Application Development. Some of the examples are -NetFlix, Facebook, Uber, LinkedIn etc.
  • JavaScript is used in Mobile Application Development. Some of the examples are- Spotify, Instagram, Facebook, Skype, Uber etc.
  • JavaScript is used in Game Development. Let’s see some games where JavaScript is used- Angry birds, Candy Crush ,Systems Offline, Re-wire, Offline Paradise etc.

Cool Facts about Javascript

  • Javascript was never meant to become the cornerstone of modern web development. In fact, the language is created in less than two weeks.
  • When the internet is boomed with public usage in 1990s, It let to the first “browser war”, between Microsoft(Internet Explorer) and NetScape ( NetScape Navigator) .
  • NetScape needed a scripting language for easier programming .This is where JavaScript came into light. In 1995, JavaScript was developed by Brendan Eich within 10 days.
  • Compared to many other languages, JavaScript offers one of the more beginner-friendly entry point to the world of coding.
  • The Great thing about JavaScript is that it comes installed on every modern web browser.
  • JavaScript has the backing of some of the biggest IT industries.

As we have answered why you should learn Javascript and now lets dive into writing our 1st ever Javascript program which is the legendary “Hello World!” program.

The interesting thing here is we can write JavaScript code and see its executing in 3 different unique ways which no other language can be done. Now Let’s start with Hello World and check out our 3 ways of doing it. Fire up your machine and follow along with me.

Run your Javascript code in 3 unique ways

Runnig JS code in browser

A good way to learn JavaScript is to run it in browser’s JavaScript console. Just open your favorite browser and press F12 key or Ctrl + Shift + I on your keyboard.

Click on the Console tab

You will see something like this on the screen now click on the console tab which I marked. And thats your plaground, yes you heard me correct you can write javascript code here. Lets write our legendary program here and see.

Thats all it. We have successfully printed our Hellow World! and don’t bother about the syntax and commands we get there soon in our up coming blogs.

Running Javascript code through HTML file

For this you have to create a HTML file and in script tag you can write your JS code or link your JS file. Let me walk you through this. First open any editor of your choice my personal recommendation is Visual studio Code. Just create a new file and name it with .html extension. then write this code.

<html>
        <body>
             <h1>Hello World!<h1>    
         </body>
         <script>
             alert(“Hello World”)
         </script>
</html>

save the html file, now just open that html file you can see the file opened in your browser and an alert pops up.

Running JS Locally like any other language

This is more convenient way of writing Javascript code. For this you have to install node.js in your machine. you can install it here. you follow the steps mentioned there for installing. Once you are done with installation, open your favorite editor, create a new file name it and save it with .js extension same as in image below.

Just write the command to print and save it.

console.log("Hello World!")

Now open the terminal(cmd) and type

node helloworld.js

There you can see the output and don’t forget that you properly navigate to the file path and then run the command or else it may won’t work.

You can also directly use terminal to run js commands, all you have to do is run “node” in your terminal and play ground will be ready for you to play with js same like this.

Now that you all know how to run and use JS, we will meet you in the next blog with some basic stuff. Make sure you get yourself comfortable with VS Code editor.

Let’s discuss the following in our next blog – Variables- let, var, const, Data types-Why we call data types as objects, Conditional Clauses-if, if else, else if, switch, Loops-for, for/in, for/of, for each, while, do/while, Functions.

Leave a comment if you have any query and give us your feedback as well.

Follow our blog’s Facebook page at fb.com/HelloWorldFB.

Check out my video on what tech should a computer science student learn at college!

3 responses to “Get Started With JAVASCRIPT”

Leave a reply to ปั้มไลค์ Cancel reply

Design a site like this with WordPress.com
Get started