delete : delete : Operators JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Operators » delete »

 

delete










Syntax








delete property



The delete operator deletes properties from objects and array elements from arrays by making them undefined.

Some objects, such as variables created by the var statement, are not affected by the delete operator.












<html>
    <script language="JavaScript">
    <!--
    theDate = new Date();
    document.write("theDate=",theDate,"<br>Deleting theDate!<br>");

    delete theDate;
    document.write("theDate=",theDate);   //theDate is undefined
    -->

    </script>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Operators
» delete