Learn

Your newest website is a massive hit. Users from all over the world are flocking to see what you have to offer. However, you start hearing from some customers that they can’t use your site. It won’t load on their browser, and the console says that there are syntax errors! That’s weird. There aren’t any errors on your computer. What’s going on?

A website sends its code to a browser to be interpreted and run. People use different browser applications, each running a particular version, depending on when it was last updated.

As new features get added to JavaScript, browsers need to update to recognize and interpret those features. When a browser isn’t updated, it won’t see new syntax as valid JavaScript code, throwing an error. Users with outdated browsers can see a completely different (and likely broken) version of your site!

Can we make our site work for everyone, even those who forgot to update their browser for the last decade? Should we write our JavaScript using only the oldest syntax?

In this lesson, we will explore this issue of browser compatibility and introduce transpilation as a way to solve it.

We will learn to use a tool called Babel to automatically translate our fancy modern JavaScript into something that even an ancient browser could understand!

Instructions

Take a look at the code on the right. Can you recognize any modern JavaScript syntax that might be problematic for an older browser?

Click “Next” when you are ready to move on.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?