Back to Cheat Sheets

Writing

JavaScript for Beginners Series - Part 2 (English & Darija)

Part 2 of the JavaScript for Beginners series by Ibtissam Oulahchoum. This guide dives into Data Types, distinguishing between Primitive types (String, Number, Boolean, Null, Undefined) and Non-Primitive types (Objects), with simplified explanations in Moroccan Darija.

JavaScript Data Types Web Development Darija Programming Basics

January 23, 2026 · 2 min read

JavaScript for Beginners Series - Part 2 (English & Darija)

Introduction

Welcome to Part 2 of the JavaScript for Beginners Series. In this part, we explore Data Types—how JavaScript handles different kinds of information like text, numbers, and logic.

1. Primitive Data Types (الأنواع الأولية)

These are the most basic data types in JavaScript:

    • STRING (النصوص)
    • Used for textual data. You can use single quotes ('...'), double quotes ("..."), or backticks (`...`).
    • Example: const greeting = "Hello, World!";
    • Darija: كيستعمل لتخزين النصوص.
    • NUMBER (الأرقام)
    • Used for all numbers, including integers and decimals (floating-point numbers).
    • Example: let userAge = 25; | const price = 19.99;
    • Darija: كيستعمل لتخزين جميع أنواع الأرقام، سواء كانت صحيحة أو فيها الفاصلة.
    • BOOLEAN (القيم المنطقية)
    • Represents a logical entity and can only have two values: true or false. It is the foundation of decision-making in code.
    • Example: const isLoggedIn = true; | let hasPermission = false;
    • Darija: كيمثل القيم المنطقية و هو أساس اتخاذ القرارات ف الكود و عندو جوج احتمالات فقط: صحيح True ، خطأ False.
    • UNDEFINED (غير معرف)
    • A variable that has been declared but has not yet been assigned a value.
    • Example: let userCity; // Outputs: undefined
    • Darija: هو القيمة ديال أي متغير تم الإعلان ديالو ولكن مزال ما تعطاتو حتى شي قيمة.
    • NULL (فارغ)
    • Represents the intentional absence of any object value. It is a value you, the programmer, explicitly assign to mean "nothing."
    • Example: let selectedUser = null;
    • Darija: كيمثل الغياب المتعمد لشي قيمة. يعني نتا كبروغرامور كتعطيها لمتغير باش تقول بلي راه "خاوي" عن قصد.

2. The Non-Primitive Type (النوع المركب)

Object

The most complex and important data type. It is a collection of key-value pairs. Almost everything in JavaScript is an object.

    • Darija: هو أهم وأشهر نوع مرّكب، كيتستعمل باش تجمع بّزاف ديال البيانات فبلاصة وحدة على شكل "مفتاح-قيمة" (key-value). تقريبًا كلشي فجافاسكريبت هو اوبجيكت.

Code Example:

const person = {
  firstName: "Fatima",
  age: 30,
  isDeveloper: true
};

3. Pro Tip: Checking The Type with typeof

You can use the typeof operator to find out the data type of any variable.

    • Darija: باش تعرف شنو نوع البيانات ديال اي متغير تقدر تستعمل typeof.

Code Example:

console.log(typeof "Hello");       // "string"
console.log(typeof 25);            // "number"
console.log(typeof true);          // "boolean"
console.log(typeof {name: "Ali"}); // "object"

Related Cheat Sheets

Mentorship

Want to learn, not just read?

These cheat sheets are the short version. If you want the long one, I teach — one on one, at your pace, on what you are actually trying to build.

Let's talk
  • Learn with guidance

    I will walk you through the fundamentals, review your code, and help you grow past the tutorials.

  • Choose your career path

    Not sure which direction to take? We will talk it through and map a path that fits your strengths and your goals.

Want to work together?

I'm always open to discussing new projects.

Get in Touch