From the course: Learning App Building with Vanilla JavaScript
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Transpile vanilla JavaScript - JavaScript Tutorial
From the course: Learning App Building with Vanilla JavaScript
Transpile vanilla JavaScript
- [Instructor] We've finished removing all the jQuery and React code from our app, so we should be able to run it with only our script.js file. So here in our index.html file, I've scrolled to the bottom, and here are our script elements, and we can comment out the first four. Now, in addition to React and jQuery files, we have Babel here, and Babel is a library that converts JavaScript code that uses newer JavaScript syntax features into older, more widely supported code. Now, to write our React components using JSX, we had to include Babel as a dependency and specify that our script was of type text/babel rather than text/javascript. But now, without React code, we can remove the type attribute altogether from our script.js element, so browsers will treat this as generic JavaScript code rather than code that needs Babel to translate it. So I'll save this, and I'll go back to my browser, and Shift reload, and then I'll enter Quito in the box, and I'll click the button. And I get the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.