Sunday, 06 September 2026
Advertisement Advertise Your advert could be here Reach thousands of learners and ICT professionals across Rwanda. Contact us
Advertisement Opportunity Jobs, scholarships & hackathons Fresh openings from Rwandan job boards are pulled in every hour. See openings

What JavaScript is and where it runs

JavaScript basics · lesson 1 of 10

In this lesson: Run JavaScript in a page and in the browser console.

HTML is structure. CSS is appearance. JavaScript is behaviour — it is a real programming language, and it is what makes a page respond to people.

Adding it to a page

<!-- best: an external file, just before </body> -->
<script src="/js/app.js"></script>

<!-- or inline, for a quick test -->
<script>
  console.log('Hello from JavaScript');
</script>

Put the <script> just before the closing </body> tag. If it runs before the HTML exists, your code will not find the elements it wants. (The alternative is <script src="..." defer> in the head, which waits for the document.)

The console is your workshop

Press F12 in your browser and open the Console tab. You can type JavaScript straight into it and see the result immediately. Try:

2 + 2
'Yanjye'.toUpperCase()
console.log('It works');
Learn to read errors. When something breaks, the console tells you the message, the file and the line number. Beginners often ignore it and guess. Reading the red text is the single fastest way to improve.

Statements and comments

let name = 'Aline';   // a single-line comment

/*
   A comment spanning
   several lines
*/

Semicolons end statements. JavaScript will insert them for you in most cases, but writing them yourself avoids a small class of genuinely confusing bugs.

Case matters

myName, myname and MyName are three different things. JavaScript convention is camelCase for variables and functions.

Create a free account to save progress

All lessons in this track

  1. 1
  2. 2
  3. 3
  4. 4
    Conditions: if, else and switch ~25 min account needed
  5. 5
    Loops ~25 min account needed
  6. 6
    Functions ~30 min account needed
  7. 7
    Arrays and array methods ~30 min account needed
  8. 8
    Objects ~25 min account needed
  9. 9
    The DOM: changing the page ~30 min account needed
  10. 10
    Events ~25 min account needed
Advertisement Yanjye Learn a new digital skill this week ICT, programming and professional courses with graded weekly assignments. Start free