What is Syntax and Variable in Java Script



What is Syntax and

Variable in Java

Script :




What is Java Script ?


Java Script is a dynamic Proggraming language .It is also very popular programming language. 



Java script has a huge amount of community and a very good marketplace. Java Script can be used in almost every platform of software development with its vast amount of framework and libery language. But Java Script mainly used in web Devloping. We don’t need any framework or library language to devlop a website with Java Script. It is only possible in Java Script to devlop web application without framework or libery language. 



Java Script let us write client-side code in the users browser .


Fullstack application :

Node js and Firebase make Java Script a server-side language as well as client-side language .Node js work for the backend of Java Script application. So you can make Full Stack application(Frontend and backend both) with Java Script. 

2.JAVASCRIPT –SYNTAX


Java Script code goes in <script> tag of html. No other proggraming language can't be used in web devlopment directly . They need Framework or Libery. But Java script can be used directly for devloping a website. 

In html page:



<script>

Java Script codes goes here........

</script>



A script tag can set in head section and body section both. But at the lower of the body section is a perfect place to set a script tag. That will give the DOM(document object model) load before Java Script code. That will be very helpfull to devlop.

You can also use a eventListener for load the dom content before. But as a begginer setting script tag at the bottom of the body section will be better for you.



But we normally don’t write Java Script code in a html page. When your project will be more complex you might need a file for Java Script. 

You can name the file anything you want just you have to write " .js " after the file name. It could be index.js or app.js and more.



Suppose you have a js file name Index.js

 In order to attached the file to html you can do just that:-



<script src="index.js"> </script>



And now you are good to write js code in index.js.

Var X= 1;

Var Y= 2;

Var C = 1+2;

If we console.log(C)

In console we can see the Output will be 3. 

1+2 will be calculated in the output . In proggraming we use variable to store data. Var is a variable in Java Script. 



Var X is the name of the variable and the 1 is the value of the variable .



Variable:


Variable is use to store data in Java Script. Var is a variable.




Var X= 1;

Var Y= 2;

Var C = X+Y;

console.log(C)



You can see the outout in the console that it is 3. Because the C variable has the value of X+Y.

And the X has the value of 1 and the Y have the value of 2 . So C variable got the value of

 1+2=3; 

That is simple as that.



If you do that :



Var X= 1;

Var Y= 2;

Var C = X+Y;

document.write(C);

Then you'll be able to see 3 in the webpage directly (not in the console)



But using var as a variable not a good practice. Before 2015 there was just "Var" variable in Java Script. But in latest version of Java Script there is "Let" and "Const". As a begginer it could be hard for you to understand that why you shouldn’t use var. For now just remember that you have to use let or const. But you can't rewrite const. So if you are confuse thet just use let.

So Let's use it:-



Let x=7

Let y=8

Let Fahad=x+y

document.write(Fahad)



Output:15

Because of we document.write the variable Fahad and it was x+y. So it plus those value. x was 7 and y was 8 so it became 15 .



We can also use const variable here.



Const x=7

Const y=8

Const Fahad=x+y

document.write(Fahad)



That will work just fine. But you can't rewrite this value. So if you confuse about const and let just use let. That will work just fine.











Java Script full course part 1

What is Java Script ?
Java Script is a dynamic Proggraming language .It is also very popular programming language. 



Java script has a huge amount of community and a very good marketplace. Java Script can be used in almost every platform of software development with its vast amount of framework and libery language. But Java Script mainly used in web Devloping. We don’t need any framework or library language to devlop a website with Java Script. It is only possible in Java Script to devlop web application without framework or libery language. 



Java Script let us write client-side code in the users browser .


Fullstack application :

Node js and Firebase make Java Script a server-side language as well as client-side language .Node js work for the backend of Java Script application. So you can make Full Stack application(Frontend and backend both) with Java Script. 

2.JAVASCRIPT –SYNTAX


Java Script code goes in <script> tag of html. No other proggraming language can't be used in web devlopment directly . They need Framework or Libery. But Java script can be used directly for devloping a website. 

In html page:



<script>

Java Script codes goes here........

</script>



A script tag can set in head section and body section both. But at the lower of the body section is a perfect place to set a script tag. That will give the DOM(document object model) load before Java Script code. That will be very helpfull to devlop.

You can also use a eventListener for load the dom content before. But as a begginer setting script tag at the bottom of the body section will be better for you.



But we normally don’t write Java Script code in a html page. When your project will be more complex you might need a file for Java Script. 

You can name the file anything you want just you have to write " .js " after the file name. It could be index.js or app.js and more.



Suppose you have a js file name Index.js

 In order to attached the file to html you can do just that:-



<script src="index.js"> </script>



And now you are good to write js code in index.js.

Var X= 1;

Var Y= 2;

Var C = 1+2;

If we console.log(C)

In console we can see the Output will be 3. 

1+2 will be calculated in the output . In proggraming we use variable to store data. Var is a variable in Java Script. 



Var X is the name of the variable and the 1 is the value of the variable .



Variable:


Variable is use to store data in Java Script. Var is a variable.




Var X= 1;

Var Y= 2;

Var C = X+Y;

console.log(C)



You can see the outout in the console that it is 3. Because the C variable has the value of X+Y.

And the X has the value of 1 and the Y have the value of 2 . So C variable got the value of

 1+2=3; 

That is simple as that.



If you do that :



Var X= 1;

Var Y= 2;

Var C = X+Y;

document.write(C);

Then you'll be able to see 3 in the webpage directly (not in the console)



But using var as a variable not a good practice. Before 2015 there was just "Var" variable in Java Script. But in latest version of Java Script there is "Let" and "Const". As a begginer it could be hard for you to understand that why you shouldn’t use var. For now just remember that you have to use let or const. But you can't rewrite const. So if you are confuse thet just use let.

So Let's use it:-



Let x=7

Let y=8

Let Fahad=x+y

document.write(Fahad)



Output:15

Because of we document.write the variable Fahad and it was x+y. So it plus those value. x was 7 and y was 8 so it became 15 .



We can also use const variable here.



Const x=7

Const y=8

Const Fahad=x+y

document.write(Fahad)



That will work just fine. But you can't rewrite this value. So if you confuse about const and let just use let. That will work just fine.





Java Script full course part 1

What is Java Script ?
Java Script is a dynamic Proggraming language .It is also very popular programming language. 



Java script has a huge amount of community and a very good marketplace. Java Script can be used in almost every platform of software development with its vast amount of framework and libery language. But Java Script mainly used in web Devloping. We don’t need any framework or library language to devlop a website with Java Script. It is only possible in Java Script to devlop web application without framework or libery language. 



Java Script let us write client-side code in the users browser .


Fullstack application :

Node js and Firebase make Java Script a server-side language as well as client-side language .Node js work for the backend of Java Script application. So you can make Full Stack application(Frontend and backend both) with Java Script. 

2.JAVASCRIPT –SYNTAX


Java Script code goes in <script> tag of html. No other proggraming language can't be used in web devlopment directly . They need Framework or Libery. But Java script can be used directly for devloping a website. 

In html page:



<script>

Java Script codes goes here........

</script>



A script tag can set in head section and body section both. But at the lower of the body section is a perfect place to set a script tag. That will give the DOM(document object model) load before Java Script code. That will be very helpfull to devlop.

You can also use a eventListener for load the dom content before. But as a begginer setting script tag at the bottom of the body section will be better for you.



But we normally don’t write Java Script code in a html page. When your project will be more complex you might need a file for Java Script. 

You can name the file anything you want just you have to write " .js " after the file name. It could be index.js or app.js and more.



Suppose you have a js file name Index.js

 In order to attached the file to html you can do just that:-



<script src="index.js"> </script>



And now you are good to write js code in index.js.

Var X= 1;

Var Y= 2;

Var C = 1+2;

If we console.log(C)

In console we can see the Output will be 3. 

1+2 will be calculated in the output . In proggraming we use variable to store data. Var is a variable in Java Script. 



Var X is the name of the variable and the 1 is the value of the variable .



Variable:


Variable is use to store data in Java Script. Var is a variable.




Var X= 1;

Var Y= 2;

Var C = X+Y;

console.log(C)



You can see the outout in the console that it is 3. Because the C variable has the value of X+Y.

And the X has the value of 1 and the Y have the value of 2 . So C variable got the value of

 1+2=3; 

That is simple as that.



If you do that :



Var X= 1;

Var Y= 2;

Var C = X+Y;

document.write(C);

Then you'll be able to see 3 in the webpage directly (not in the console)



But using var as a variable not a good practice. Before 2015 there was just "Var" variable in Java Script. But in latest version of Java Script there is "Let" and "Const". As a begginer it could be hard for you to understand that why you shouldn’t use var. For now just remember that you have to use let or const. But you can't rewrite const. So if you are confuse thet just use let.

So Let's use it:-



Let x=7

Let y=8

Let Fahad=x+y

document.write(Fahad)



Output:15

Because of we document.write the variable Fahad and it was x+y. So it plus those value. x was 7 and y was 8 so it became 15 .



We can also use const variable here.



Const x=7

Const y=8

Const Fahad=x+y

document.write(Fahad)



That will work just fine. But you can't rewrite this value. So if you confuse about const and let just use let. That will work just fine.