-2

I know that what actually null is it is an empty value but I just want to ask whether it is a pointer(as in C/C++) or just a literal.

  • 1
    The question doesn't make a lot of sense. Literals are a thing you put in source code to create a value, not a value in their own right. – Quentin May 24 '17 at 10:57
  • When in doubt.... [look it up in docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null). Research is expected before asking questions here – charlietfl May 24 '17 at 10:58
  • @charlietfl or in [the actual docs](https://www.ecma-international.org/ecma-262/6.0/#sec-null-value) – evolutionxbox May 24 '17 at 11:00
  • Null is a primitive value. Maybe it will helpful. https://stackoverflow.com/questions/801032/why-is-null-an-object-and-whats-the-difference-between-null-and-undefined/7968470#7968470 – Stanislav Mayorov May 24 '17 at 11:01
  • But i asked is it a pointer or not – Suyash Srivastava May 24 '17 at 15:06

1 Answers1

0

The value null is written with a literal: null. null is not an identifier for a property of the global object, like undefined can be. Instead, null expresses a lack of identification, indicating that a variable points to no object. In APIs, null is often retrieved in a place where an object can be expected but no object is relevant.

// foo does not exist. It is not defined and has never been initialized:
foo;
"ReferenceError: foo is not defined"

// foo is known to exist now but it has no type or value:
var foo = null; foo;
"null"

from here you can read more .