# Check for value

**URL:** https://forum.kirupa.com/t/check-for-value/109025
**Category:** Uncategorized
**Created:** [April 30, 2004, 9:31pm UTC](https://forum.kirupa.com/t/check-for-value/109025 "2004-04-30T21:31:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![yollo](https://avatars.discourse-cdn.com/v4/letter/y/9fc348/32.png) [@yollo](https://forum.kirupa.com/u/yollo)
#### Post date: [April 30, 2004, 9:31pm UTC](https://forum.kirupa.com/t/check-for-value/109025/1 "2004-04-30T21:31:56Z")

</div>

Is there an expression that will to check to see if a variable has any value at all? I don’t want to check to see if a variable is true or false or if its value is 8 or 9 or whatever. i want to check to see if any value has been assigned to it at all.

“!” doesn’t seem to do the trick. I thought that

if (! variable){  
// do something  
}

would work if “variable” simply had no value, but this doesn’t seem to be the case.
