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.
Asked
Active
Viewed 43 times
-2
-
1The 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 Answers
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 .

Mohanad Inairat
- 81
- 7
-
yes we can say its a pointer to a place in memory but no object is relevant to that place – Mohanad Inairat May 24 '17 at 16:08
-