Which is not a JavaScript data type?

Table of Contents

Introduction

JavaScript has seven primitive data types and one non-primitive data type (Object). However, some terms may seem like data types but are not.

JavaScript Data Types

TypeExample
Numberlet num = 10;
Stringlet text = "Hello";
Booleanlet isTrue = true;
Undefinedlet x; // undefined
Nulllet y = null;
BigIntlet big = 9007199254740991n;
Symbollet sym = Symbol("id");
Object (non-primitive)let obj = { name: "Alice" };

Which is NOT a JavaScript Data Type?

Here are some options that are not valid JavaScript data types:

  1. Float – JavaScript does not have a separate "float" type. All numbers, whether integers or decimals, are categorized under Number.
    Example:
  1. Double – JavaScript does not have a "double" precision type like Java or C++. All floating-point numbers are stored as 64-bit floating-point numbers.
  2. Character (char) – JavaScript does not have a char type like C or Java. A single character is stored as a String.
    Example:
  1. Void – JavaScript does not have a void data type. However, void is a keyword used to return undefined.
    Example:

Conclusion

Which is NOT a JavaScript Data Type?

  • Float
  • Double
  • Char
  • Void

Valid JavaScript Data Types:

  • Number
  • String
  • Boolean
  • Undefined
  • Null
  • BigInt
  • Symbol
  • Object
Similar Questions