- Hypertext Markup Language (HTML) makes up the structure of the website
- Cascading Style Sheets (CSS) is responsible for styling
- JavaScript (JS) is responsible for enhanced user interactions
Browser compatibility
Websites are rendered by the web browsers thus JS is also interpreted by the browsers, and this is why there are differences between their capabilities in interpreting JS.You have two options here:
- check for browser compatibility yourself e.g. in the MDN JS Reference
- use a compiler/polyfill e.g. Babel to take care of compatibility for you
The standardized version of JavaScript is called ECMAScript. It has several editions since 1997. The 6th edition called ES6 and ES2015 added a significant new syntax and new libraries that generally make development easier, however it is not supported by all browsers.
The main browser compatibility issue is with Internet Explorer. Currently (2018/05) the only supported Internet Explorer version is IE11 and it only gets technical support and security updates from Microsoft - instead of being developed further it is replaced by Microsoft Edge.
If you want to support IE11 you have two options here:
- Use ES5 (standardized in 2009) - 99% of features supported by IE11
- Use ES6/ES2015 with a compiler/polyfill - 11% of features supported by IE11
Why you want to use the enhanced Javascript syntax
Probably the most important new feature of ES2015 is the use of promises instead of callbacks. This was then further simplified by the introduction of the async/await keywords in ES2017. Here is a demonstration of the above, and here is a guide to picking the right asynchronous way out of the three.
If this is not enough see what else is in ES2015.
Frameworks and Libraries
There are many frameworks and libraries to help developers implement frontend applications. If you read How it feels to learn JavaScript in 2016 you'll get a general idea of how fast the frontend technology is changing.Here are some recent trends:
Running Javascript outside of the browser
It is possible to use JS outside of the context of a web browser, for example it can be used to write server code or desktop applications. The most well known JS runtime environment is NodeJS. It has a package manager called npm.If you want to run tests, compile code, do style checks it is a convenient way to run these commands and maintain these dependencies through npm.
Further readings
- The Complete ECMAScript 2015-2017 Guide
- W3C's JavaScript best practices
- Pick an IDE for JavaScript development