JavaScript

 

What is javascript ?

JavaScript is a scripting or a programming language. It is used to develop web applications. In web applications, rather than displaying static content to the user JavaScript allows the developer to develop dynamic and advance features such as calculation, manipulation and validation which the user can interact with. 

What are the differences between JavaScript and JAVA (JavaScript Vs. JAVA) ?

JavaScript

JAVA

  • Interpreter based. (no need to compile)

  • Compiler based.

  • Not a Server side language.

  • Server side language.

  • Runs on the browser.

  • Runs on virtual machines.

  • Weakly typed language.

  • Strongly typed language.

  • Single Threaded.

  • Multi - Threaded.

What is Single-Threaded ?

JavaScript code is executed in an order.  Piece of code should be finished executing in order to move to the next part of the program.

What is the most important fact in JavaScript ?

JavaScript is the only high level language which can run anywhere such as on a Server , browser and a database. It means JS is a true full-stack language.

How the Concurrency works ?

When an I/O operation occurs, JavaScript executes it and  hands it over to the thread pool and without waiting for a response it continue its task.

What are the advantages and disadvantages of JavaScript?

Advantages

Disadvantages

  • Easy to learn and implement.

  • Sometimes the code is interpreted in different ways in different browsers. It should be tested in various platforms before publishing.

  • As JS is an interpreted language, it reduces the time required to compile. So JS speed is high when execution.

  • As JavaScript executes in the client side, it can be caused for many malicious purposes. So that the client-side security is low. (because it can be viewed by the client so sometimes they use it for malicious purposes)

  • Popularity - modern browsers support Javascript so most of the companies use javascript.

  • Supports only single inheritance. Does not support multiple inheritance.

  • Not a server side language. It is a client side application. Data validation can be done even without sending to the server.

  • A single code error can stop the execution of the whole javascript code on the website.

  • Gives the ability to create better user interfaces with better user experience.

 

Comments