Languages
[Edit]
EN

JavaScript - data types

0 points
Created by:
elmer
646

In this article, we'll show you commonly used data types in JavaScript.

There are eight basic data types:

  • string for strings (zero or more characters).
  • number for integers or floating points.
  • bigint is for integer numbers of arbitrary length.
  • boolean - only have true/false value.
  • null for unknown values.
  • undefined for unassigned values.
  • object - key-value pairs of collection of data.
  • symbol for unique identifiers.

 

1. The typeof operator

Edit

 More complex examples

Edit

Note: simple types and undefined were marked in comments with ----->

Comparing the result of typeof, toString and instanceof

Edit

References

Edit
  1. JavaScript - how to check type of object? 
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript tutorial

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join