1. Introduction of Javascript

 Introduction of JS

JavaScript: JavaScript (originally known as LiveScript) is cross-platform, object-based scripting language that was developed by Netscape programmer Brendan Eich for both client side and server side.

It is a lightweight programming language that is interpreted by web browser when the web page is loaded. JavaScript is the most popular language and almost easy to learn as HTML.


Features of JavaScript Language (JS)




1. JavaScript (JS) is a high-level, interpreted, cross-platform, and open-source programming language.

2. JavaScript (js) is a lightweight object-based scripting programming language that is mainly used in web programming.

3. It supports both client-side and server-side scripting.

4. It is responsible for making web pages interactive and responsive. Like HTML defines the content and structure of web page, CSS styles the layout, and JavaScript make that web page interactive.

5. JS is not a compiled language, but it is an interpreted language. The JavaScript interpreter embedded inside the web browser software (such as Microsoft Internet Explorer, Google Chrome, Firefox, Opera, etc) translates the JavaScript code in the order they are written.

6. All popular web browsers such as Chrome, Firefox, Opera, etc. support JavaScript as they provide built-in execution environments.

7. JavaScript follows the syntax and structure of the C programming language. Thus, it is a structured programming language.

8. JavaScript is a weakly typed language, where certain types are implicitly cast (depending on the operation).

9. It is a case-sensitive language.

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

11. It provides good control to the users over the web browsers.

12. JavaScript programs do not depend on any specific hardware platform or operating system. It run inside HTML document.

13. Since JS is a client-side scripting language, JS code can be directly embedded into HTML pages.



History of JavaScript (JS)

- JavaScript was first introduced in December 1995. This technology was developed in just ten days by Brendan Eich at Netscape Communication Corporation for both client-side and server-side scripting.

- JavaScript was originally called Mocha, but quickly became known as LiveScript and, later, JavaScript.

- In June 1997, JavaScript 1.1 was submitted to the European Computer Manufacturers Association (ECMA) as “ECMAScript”.

- Current Version of “ECMAScript” is ES14 (14th Edition ) In June 2023.


Types of JavaScript

JavaScript is categorized into two types. They are:

1. Inline JavaScript

2. External JavaScript



Scripting Language

- The programming language in which script is written is called scripting language or simply script language.

- A scripting language is a type of programming language that provides to write scripts using the syntax of a scripting language.

- Interpreted : The source code of the program or script does not get compiled before it is executed. It is read directly, one line at a time, by a program called interpreter.


What is Script?

- A script is a program that consists of a sequence of statements. It is written by using the syntax or commands of a scripting language or interpreted language. It is ​embedded in an HTML web page, interpreted, and executed by a certain scripting engine.

- For example, JavaScript and PHP are the easiest scripting languages.



Types of Scripting Language

Scripting language can be classified into two main categories that are as follows:

1. Client-side script

2. Server-side script


1. Client-side script

- Client side scripting is a process in which the code along with HTML web page is sent to the client by the server. Here, the code refers to the script.

- In other simple words, client side scripting is a process in which scripts are executed by browsers without connecting the server.

-  client side scripting language are JavaScript , VBScript (Visual Basic) , jQuery .


Execution flow of  Client Side Scripting


2. Server-side script

- Server side scripting is a process in which server data formats into an HTML response before it is sent back to the web browser.

- In other words, a process in which the script code is executed by the web server on the server side after the page is requested is called server side scripting.

- server-side scripting languages are PHP, Python, Ruby, ASP.NET, Perl, Go, JavaScript , Java .


Difference between Scripting Language and Programming Language


Programming Language

Scripting Language


1. A computer language consisting of a set of instructions to communicate with a computer machine.

1. A kind of programming language that provides to write scripts to automate the execution of a specific action/function in a specific runtime environment.


2. Since the compiler is necessary to compile most of the programming languages, therefore, they are also known as compiled language or compiler-based language.

2. Since the interpreter is necessary to interpret most of the programming languages, therefore, they are also known as interpreted language or interpreted-based language.


3. It is used in software or application development.

3. It is used in web development.


4. Programming language executes (or runs) independently of any parent (exterior) program. It is self executable and no host is required.

4. Scripting language execute (or run) inside another program. It requires a host.


5. As programming language uses a compiler, hence the source code of complete program is converted into machine code in one shot.

5. As scripting language uses an interpreter, hence the program code is converted into machine code line by line.


6. Compilation is necessary for programming languages.

6. Interpretation is necessary for scripting languages. No need of compilation is required.


7. After compilation, a program takes long time to execute since the length of code is typically high.

7. A script takes less time to execute, as scripts are generally short.


8. The program written in programming languages generates a .exe file.

8. The program written in scripting languages does not generate a .exe file.


9. In programming languages, writing a program is difficult because it requires numerous lines of code for each task.9. In scripting languages, writing a program is quite easy because it requires few lines of code for each task.


10. Programming languages have high maintenance cost.

10. Scripting languages typically have a low maintenance cost.


11. Some popular examples of programming languages are C, C++, Java, Scala, COBOL, etc.

11. Some popular examples of scripting languages are JavaScript, Python, Perl, etc.


Comments

Popular posts from this blog

2. Datatypes & Variables in Javascript

6. Object and Array in Javascript