Javascript

Published: (November 30, 2025 at 01:54 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

What is JavaScript?

Key concepts

  • Interpreted
  • Dynamical
  • Scripting
  • Object oriented
  • Variables declaration

Variable declarations

let

let age = 30;
age = 31; // This is allowed

const

const pi = 3.14;

var

var count = 5;
var count = 10; // This is allowed

Rules for identifiers of variables

  • Valid characters: letters, numbers, underscores (_), and dollar signs ($). Numbers cannot be the first character.
  • Case‑sensitive: myVariable is different from myvariable.
  • Reserved words: Keywords such as if, for, function, etc., cannot be used as variable names.

Data types

Primitive types

  1. Number – numeric values (integers and decimals).
  2. String – text enclosed in single or double quotes.
  3. Boolean – logical value (true or false).
  4. Undefined – a declared variable without an assigned value.
    // Output: undefined
  5. Null – intentional absence of any value.
    let empty = null;
  6. Symbol – unique and immutable values, often used as object keys.
    let sym = Symbol('unique');
  7. BigInt – integers larger than Number.MAX_SAFE_INTEGER.
    let bigNumber = 123456789012345678901234567890n;

Non‑primitive datatypes

Non‑primitive types are objects and can store collections of data or more complex entities.

  1. Object – key‑value pairs.
    let obj = {
        // properties go here
    };
  2. Array – ordered list of values.
    let a = ["red", "green", "blue"];
  3. Function – reusable blocks of code.
    function fun() {
        // function body
    }

Exploring JavaScript datatypes and variables: understanding common expressions

console.log(null === undefined);
  • Expression: null === undefined
  • Result: false
Back to Blog

Related posts

Read more »

Day 1276 : Career Climbing

Saturday Before heading to the station, I did some coding on my current side project. Made some pretty good progress and then it was time to head out. Made i...

JWT Token Validator Challenge

Overview In 2019 Django’s session management framework contained a subtle but catastrophic vulnerability CVE‑2019‑11358. The framework failed to properly inv...