Modern JavaScript

02.08.2018 |

Episode #9 of the course Fundamentals of JavaScript by Matt Fay

 

In this lesson, we’re going to discuss modern JavaScript. Like we learned in Lesson 1, JavaScript has come a long way. Everything we’ve learned up to this point is valid and useful. You need to know it in order to jump into the world of modern JavaScript!

 

JavaScript on the Server

We learned in Lesson 1 how JavaScript originally started out as a means to create simple animations on web pages. It stayed that way for awhile, and it’s still used in such a way today. Yet, lots has changed. Not only is JavaScript used for simple web pages, but it’s also used to deliver them. The JavaScript we have been talking about so far and what you may be familiar with is what is known as client-side JavaScript, or front-end JavaScript.

When you make a request to a web server, you’re asking the server for a resource. When you go to google.com, that request is sent to a server, which in return, sends you the HTML, CSS, and JavaScript that make Google.com what it is. Note that Google isn’t necessarily using JavaScript to send those files, as there are plenty of other server-side languages. But it can indeed be done with JavaScript, and many people and big companies such as Microsoft, Walmart, Netflix, and LinkedIn are making use of JavaScript as a server-side language.

This was unimagined. JavaScript on the server? That’s crazy talk! But it happened, thanks to people like Ryan Dahl, who created Node.js in 2009 (see the source code here).

A fun and interesting project is NodeBots, robots controlled with JavaScript (Node.js). NodeBots host events where teams of people get together and completely build a robot from the ground up (hardware and all) and program it with JavaScript.

 

JavaScript on the Desktop

Yes, you’ve read that title correctly! JavaScript can even be used to create desktop applications with tools such as Electron (see the source code here). Some notable desktop applications written in JavaScript include:

• VSCode, Microsoft’s famous open-source text editor

• Atom, another popular text editor

• Unity, a user interface for the Ubuntu operating system

If you’re familiar with HTML, CSS, and/or JavaScript, you can build your own desktop applications as well—Electron makes it easy to do so. Head on over to their site to get started!

 

 

React.js

React.js is a JavaScript library developed by a team of developers at Facebook, among others. It is an open-source project (see the source code here), which means that anyone can contribute to it.

React.js serves as a library to deliver user interfaces. It takes away HTML (sort of), and you write your application in JavaScript, or JSX, which has a similar syntax to HTML. Your JavaScript files get compiled into HTML. It’s fairly easy to get started with React, and the team at Facebook has created a neat CLI (Command-line interface) for creating applications quickly, called “create-react-app,” and that takes away all the configurations you’d need to implement by setting you up quickly.

There are similar libraries to React, such as Angular.js, Vue.js, etc.

In today’s lesson, you’ve captured what JavaScript is like in the current year. It is interesting and exciting! Stay tuned for the final lesson, the course conclusion.

 

Share with friends