Why javascript?
JavaScript is a lightweight,high-level,dynamic and interpreted programming language. Alongside HTML and CSS, JavaScript is one of the core technologies Web Development. JavaScript is used to make webpages interactive.![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrGyemjtOmluOZr60iq9V8x9jZr50asH06-iNb_2iVCyVwwp6qt1sCc9jdagXHhium4u5RenGbtqOZS1_mG3JI5dRqRk4VwwOQpaZXmHYVDdrmF38RMU66m4MA4JDN69dzAe_h306FD-g/s1600/javascript+introduction.png)
Who can learn JavaScript?
One should have prior knowledge of HTML coding and some exposure to object-oriented programming concepts .
Types of JavaScript
Same as CSS JavaScript also of three types
1→External.
2→ Internal.
3→ Inline.
Note:- JavaScript accepts both double and single quotes.
Syntax:
Javascript can be implemented using javascript statements
that are placed within the
Example:
Welcome to JavaScript !
Usage of Semicolons:
In JavaScript semicolons are optional. Unlike C,C++,Java languages JavaScript allows you to omit this semicolon if each of your statements are placed on a separate line.
Example 1:
1020
Example 2:
1020
The basic difference between example 1&2 was after each statement in the example 1 we didnt used semicolon,but in example 2 we used semicolon,basically the output was same in both the scenarios.
Note:- But it is not a good practice to ignore semicolons.
Case Sensitivity:
JavaScript is a case-sensitive language. This means that language variables,keywords etc must always be typed consistent capitalization of letters.
Comments in javascript:
1) Any text between a // and the end of the line will be treated as a comment and it will be ignored by JavaScript.
2) Any text between /* and */ will also be treated as a comment and that will be ignored by JavaScript.
3) Any text between <!-- and //-- > will also be treated as a comment and that will be ignored by JavaScript.
Example:
JavaScript is a lightweight,high-level,dynamic and interpreted programming language. Alongside HTML and CSS, JavaScript is one of the core technologies Web Development. JavaScript is used to make webpages interactive.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrGyemjtOmluOZr60iq9V8x9jZr50asH06-iNb_2iVCyVwwp6qt1sCc9jdagXHhium4u5RenGbtqOZS1_mG3JI5dRqRk4VwwOQpaZXmHYVDdrmF38RMU66m4MA4JDN69dzAe_h306FD-g/s1600/javascript+introduction.png)
One should have prior knowledge of HTML coding and some exposure to object-oriented programming concepts .
Types of JavaScript
Same as CSS JavaScript also of three types
1→External.
2→ Internal.
3→ Inline.
Note:- JavaScript accepts both double and single quotes.
Syntax:
Javascript can be implemented using javascript statements
that are placed within the
<script> .. </script>
Example:
<html> <body> <script> document.write("Welcome to JavaScript !"); </script> </body> </html>Output:
Welcome to JavaScript !
Usage of Semicolons:
In JavaScript semicolons are optional. Unlike C,C++,Java languages JavaScript allows you to omit this semicolon if each of your statements are placed on a separate line.
Example 1:
<html> <body> <script> var a = 10 var 2 = 20 document.write(a) document.write(b) </script> </body> </html>Output :
1020
Example 2:
<html> <body> <script > var a = 10; var 2 = 20; document.write(a); document.write(b); </script> </body> </html>Output:
1020
The basic difference between example 1&2 was after each statement in the example 1 we didnt used semicolon,but in example 2 we used semicolon,basically the output was same in both the scenarios.
Note:- But it is not a good practice to ignore semicolons.
Case Sensitivity:
JavaScript is a case-sensitive language. This means that language variables,keywords etc must always be typed consistent capitalization of letters.
Comments in javascript:
1) Any text between a // and the end of the line will be treated as a comment and it will be ignored by JavaScript.
2) Any text between /* and */ will also be treated as a comment and that will be ignored by JavaScript.
3) Any text between <!-- and //-- > will also be treated as a comment and that will be ignored by JavaScript.
Example:
<html> <body> <script> <!-- // This is a comment. used for single line comment same as c programming. /* * This is a multi line comment in JavaScript * It is also similar to comments in C Programming */ //-- > </script> </body> </html>
JavaScript Introduction Part 2 : Checkout
![]() | Konakalla Premsai I love to make things simple :) |
|||
![]() |
Keep teaching us. GREAT JOB THANKS!
ReplyDelete