Javascript examples for Language Basics:Introduction
Transition from undefined to null.
<!DOCTYPE HTML> <html> <head> <title>Example</title> </head> <body> <script type="text/javascript"> var myData = {/*w ww . j ava2 s . c o m*/ name: "java2s.com", }; document.writeln("Var: " + myData.topic); document.writeln("Prop: " + ("topic" in myData)); myData.topic = "CSS"; document.writeln("Var: " + myData.topic); document.writeln("Prop: " + ("topic" in myData)); myData.topic = null; document.writeln("Var: " + myData.topic); document.writeln("Prop: " + ("topic" in myData)); </script> </body> </html>