- JavaScript is a client side programming language. It means JavaScript code write in to HTML pages.When user request to any HTML page with JavaScript,the script send it to the browser and browser do something with it.
- It helps to web development. Using this, can reduce the amount of time and efforts for applications.
- Developers can develop dynamic and interactive web pages using JavaScript
- Run using a single thread. JavaScript is a single threaded language.
- JavaScript not wait for until I/O operations complete. And also asynchronous because of NIO nature.
Different between Java and JavaScript.
- Java is an OOP programing language. But JavaScript is OOP scripting language.
- Java applications can run on virtual machines or browser .But JavaScript can only run on browser.
- Java and JavaScript require different plugins.
Classes and Objects in java script
- Constructor function create object using ‘new’ keyword .
- Constructor function is another function.
- When function use with ‘new’ keyword that function act as a class.
- JavaScript support to static methods and variables.
- Now use 'class' keyword for create classes in JavaScript.but it is not adopted by all JavaScript engines.
Prototypes in JavaScript
JavaScript function has an object called as prototype. It is another object instance. It used when creating objects for inheritance and adding methods to JavaScript class.
Closure
It is a feature in JavaScript where an inner function has access to the outer function's variables.variables are in function encapsulate by using this technique.