JavaScript program to delete a property of an object

Write JavaScript program to create "person" object with properties firstname, lastname, age, eye color, delete eye color property and display remaining properties of person object.

Source Code
    <title>delete operator Demo</title>
<script type="text/javascript">
    var person = {firstName: "John", lastName: "Smith", age: 30, eyeColor: "Black"};
    document.write("First name: " + person.firstName+"<br>");
    document.write("Last name: " + person.lastName+"<br>");
    document.write("Age: " + person.age+"<br>");
    document.write("Eye Color: " + person.eyeColor+"<br>");

    delete person.eyeColor;		// deleting age property from person
    if("eyeColor" in person)
        document.write("Eye Color property is available");
        document.write("Eye Color property is not available");

"Coding Hub - Learn to code" app now available on Google Play Store