Coding & Web DevelopmentBeginner4 sectionsUpdated May 24, 2026

JavaScript Basics

Variables, functions, loops, and working with the page.

Try it in the compiler

Variables

javascript
const name = 'Aminata';   // cannot be reassigned
let score = 0;            // can change
score = score + 10;

Functions

javascript
function greet(name) {
  return `Kushe, ${name}!`;
}

console.log(greet("Ibrahim"));

Loops and arrays

javascript
const learners = ['Aminata', 'Mohamed', 'Fatmata'];

for (const learner of learners) {
  console.log(learner);
}

Useful array methods

TermMeaning
.map()Transform every item into a new array
.filter()Keep only items that match a condition
.find()Get the first matching item
.lengthHow many items are in the array
Tagsjavascriptweb

Practise the reference.

Open the compiler, paste one snippet, and change it until you understand what it does.

Open the compiler
Resources, free guides, blog, cheatsheets & tools · Teki-SL