#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
Fundamentals

Numbers in JavaScript

The Number Type

JavaScript uses a single Number type to represent both integers and floating-point numbers.

let a = 10;
let b = 3.14;
let c = 10 / 3; // 3.3333333333333335

Useful Number Methods

  • Number.isInteger(5) — checks if a value is an integer.
  • parseInt("42") — converts a string to an integer.
  • parseFloat("3.14") — converts a string to a floating-point number.
  • toFixed(2) — rounds a number to a fixed number of decimal places.
  • Math.round(), Math.floor(), Math.ceil() — rounding utilities.

Special Numeric Values

NaN (Not a Number), Infinity, and -Infinity are special values within the Number type.

Ready to master real-world JavaScript development?

Learn JavaScript hands-on with mentor-led, live sessions.

Explore Course