Basic Javascript

JavaScript is a transpired language. like python

At early time , js was used for client side scripting.

login validation , animation

 

Developed by Netscape navigator.

To be discussed : Architecture of browser.

Where to run js ?

1)Browser

All browsers uses the js engines/rendering engine.

chrome : v8 engine (google) :

IE : Chakra

Mozilla Firefox : Spider Monkey

Opera : V8 engine

Note : Node js also uses the  v8 engine

c ,c++, java  : Compiled language : We write the code in c,c++. Finally they gets compiled and break down into binary language/machine code. (0101010101).

ECMA : It is an standard organization. It sets the standard for something.

Javascript fraternity gone to ECMA to set standard for Javascript.

Different versions of javascript as launched by ECMA :

ES5 : 2009 : plain js/vanilla js (college time coding). It does not contain the class keyword

ECMA2015 : ES6 : oops js. It contains class keyword

ECMA2017 : ES7

Typescript : Is is based on Es6. But developed by Microsoft. It supports Es5 + Es6 + ES7

(First appeared : 1st october 2012). Typing is taken from Duck

File extension : .tsx or .ts

Like Java , typescript is also the strongly typed language

//java. Strongly typed

class Xyz{

   public static void main(String arg[]){

       int a = 10;

       int b = 20;

       int c = a+b;

       System.out.println(“The sum is “+c);

   }

}

//javascript

var a= 10; (loosely typed language)

var c = “Mohan”;

var d = true;

The type of a variable , depends upon the value on right hand side

//Typescript

var a : number = 10;

var b : number = 20;

Uses of  JavaScript :

1)Web development

Client side

Browser , HTML5 , CSS3 , SAAS , LESS ,JS (ES5 , Es6 , Typescript), Jquery , ReactJs + ANgularJs + VueJs

2)Back end

NodeJs : It is a backend technology. It is a javascript platform

Example of others backend technologies: php , java (servlet,jsp) , .net (asp.net, webapi) , Ruby with rails , python (flask , django) , golang , cold fusion(first server side scripting)

React Js : Rich ui , fast,  performance

SEO : not good

When we use the server side scripting language : 

Php /asp.net/react SSR (server) : data + html , everything coming from server 

Very good SEO

When we use javascript ,Google does not understand .

ReactDOM.render(<Home/>)

3)IOT : Internet of things

water level sensor : kit that can measure the depth of water tank.

[kit] : manual reading

sms : reading

bluetooth

IOT : (javascript(nodejs) , python , golang etc)

Raspberry 3/Ardino kit : We attach the sensors to Resberry3

Raspberry 3 can communicate with cloud (aws + azure + google cloud)

4)Hybrid applications/ Mobility

React native (HTML + CSS3 + JS(REACT JS))

Ionic : google (HTML + CSS3 + JS(REACT JS))

Android , i-iphone

What are the features of js ?

1)Js is a single threaded but java multi threaded

comparison between the single threaded and multi threaded ?

2)Non blocking

3)asynchronous coding

Basic Output through Js :

<html>

   <head>

   </head>

   <body>

       <h1>Welcome !</h1>

      => <div id=“id1”>$$</div>

   </body>

   <script>

       document.write(“Hello world !”);

       //document is browser

       /*

       */

       console.log(“We all are programmers !”);

       //It will print over the console of browser

       //alert(‘Hello India !’);

       //confirm box

       // confirm(“are u indian ?”)

document.getElementById(“id1”).innerHTML = “Hello again !”

   </script>in

</html>

 

Site Footer