0Pricing
JavaScript Academy · Lesson

Numbers — Integers vs Floats & Math Essentials

Understand integers vs floats, common Math helpers, safe rounding, parsing, and comparing floating numbers.

Intro to numbers

Goal: Handle numbers safely.

  • Integers vs floats
  • Math helpers
  • Rounding and parsing
  • Float comparison tips
Numbers — Integers vs Floats & Math Essentials — illustration 1

Integer check

Number.isInteger tells whether a numeric value is an integer. All numbers share type "number".

// Integers and floats
const a = 5;
const b = 5.5;

console.log("a integer?", Number.isInteger(a));
console.log("b integer?", Number.isInteger(b));
console.log("type of a:", typeof a);
Numbers — Integers vs Floats & Math Essentials — illustration 2

All lessons in this course

  1. Template Literals & Common String Operations
  2. Numbers — Integers vs Floats & Math Essentials
  3. Dates — Basics, Time Zones, Intl.DateTimeFormat
← Back to JavaScript Academy