Introduction to javascript
August 2, 2017 Leave a comment
Javascript is created in early 90s by Brendan Eich at Netscape and is later introduced as a standard specification by ECMA committee. Current version supported by most browsers is ECMA5 and newly released version is ECMA 2015 aka ECMA6
Javascript is a lightweight, interpreted or JIT compiled programming language with first class functions.
It is a prototype based, multi-paradigm, dynamic language, scripting language, supporting object oriented, imperative, declarative and functional programming styles. There are lot of buzz words, and we will see each one of them
- Lightweight: It has very less foot print in the machine that its running
- Interpreted: We do not explicitly compile JS programs (like we do in JAVA, instead its compiled on the go)
- First Class Functions: Functions are first class citizens in JS which means
- we can assign functions to variables
- we can pass functions as method params
- we can return a function as a return type from a method
- Multi Paradigm: It can support all programming paradigms
- Object Oriented: model state and behavior around objects to do sth
- Imperative: step by step instructions on HOW TO DO sth (like C)
- Declarative: we tell WHAT TO DO rather than HOW TO DO (like scala)
- Functional: subset of declarative language style (scala)
- Dynamic Language: Method binding to a object is done at runtime rather than at the compile time and during compilation time, compiler wont report (for example, like Java does)
- Scripting Language: Instructions written to execute on runtime environment (like unix scripting enables with the deployment of web applications), JS is used with modifying DOM structure at the browser runtime.
Why so many programmers are not comfortable with JS by tagging it as a front end technology?
– Its because of the above traits of the language.
– Because of backward compatibility lot of bugs remained as bugs forever in JS (like == vs === , null typeof object, so on)
– Initially when it was introduced, it was meant to be friendly language and the hence it internally did lot of type coercions
Why learn JS? With NodsJS, Javascript evolved a lot and now it is being used widely across different layers
- Client side web development
- Native JS
- JQuery
- Angular, React
- Server side
- NodeJS
- Express
- Browser Extensions
so on..
Javascript runtime is usually a browser but as we learn this we can either use nodejs or mozilla firefox’s scratchpad to write and execute JS programs.
References:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
https://www.youtube.com/user/koushks
Recent Comments