JavaScriptJavaScript · Lesson 01

JavaScript Introduction

Where JS runs, how to include it and console output.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 1 checkpoints Watch on YouTube More on this topic
Transcript & captions
5/5

JavaScript runs in every browser and on servers through Node. In HTML you add it with a <script> tag — usually at the end of <body> or with the defer attribute so the DOM exists first.

htmlhtml
<script src="app.js" defer></script>
<script>
  console.log('inline script');
</script>
Try it yourself

Knowledge check

0/1 answered

What does defer do?