# Null vs undefined - The Battle for Nothing!

**URL:** <https://forum.kirupa.com/t/null-vs-undefined-the-battle-for-nothing/255991>\
**Category:** Uncategorized\
**Created:** [March 28, 2008, 9:49pm UTC](https://forum.kirupa.com/t/null-vs-undefined-the-battle-for-nothing/255991 "2008-03-28T21:49:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rinogo](https://avatars.discourse-cdn.com/v4/letter/r/a5b964/32.png) [@rinogo](https://forum.kirupa.com/u/rinogo)\
**Post date:** [March 28, 2008, 9:49pm UTC](https://forum.kirupa.com/t/null-vs-undefined-the-battle-for-nothing/255991/1 "2008-03-28T21:49:58Z")

</div>

Hey all,

So…I’m new to AS3. However, I come from a pretty diverse programming background, and my C/C++ roots have made me [necessarily] fond of ‘null’ and its ubiquitous usage.

However, in AS3, there are two different ways to assign ‘Nothing’ to a variable - null and undefined. Certainly, these values mean different things. I’ve got some guesses on which should be when in AS3, but I’d like to hear what you all think.

When should null be used?  
When should undefined be used?  
Why do we need both? Why not just null or undefined?

Looking forward to your thoughts,  
Rich
