# Deleting variables with if conditions

**URL:** <https://forum.kirupa.com/t/deleting-variables-with-if-conditions/259194>\
**Category:** flash\
**Created:** [May 1, 2008, 9:37pm UTC](https://forum.kirupa.com/t/deleting-variables-with-if-conditions/259194 "2008-05-01T21:37:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![setzer9999](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@setzer9999](https://forum.kirupa.com/u/setzer9999)\
**Post date:** [May 1, 2008, 9:37pm UTC](https://forum.kirupa.com/t/deleting-variables-with-if-conditions/259194/1 "2008-05-01T21:37:50Z")

</div>

Hello,

1. I have this code:

if(myVar2 == true){  
delete myVar1;  
}

However, even when myVar2 has not yet been established, myVar1 is being deleted.

What is causing this?
