javascript remove property from object

JavaScript
var person = {"first_name": "Billy","last_name": "Johnson"};
delete person.last_name; //delete last_name property var person = {
        name: "Harry",
        age: 16,
        gender: "Male"
    };
    
    // Deleting a property completely
    delete person.age;
    alert(person.age); // Outputs: undefined
    console.log(person); // Prints: {name: "Harry", gender: "Male"}var ourDog = {
  "name": "Camper",
  "legs": 4,
  "tails": 1,
  "friends": ["everything!"],
  "bark": "bow-wow"
};

delete ourDog.bark;var obj = {a: 5, b: 3};
delete obj["a"];
console.log(obj); // {b: 3}var myObject = {
    "name": "jon",
    "gender": "male",
    "registered": "yes"
};
delete myObject.gender;

console.log(myObject);

//other methods
delete myObject.gender;
// or,
delete myObject['gender'];
// or,
var prop = "gender";
delete myObject[prop];var string = "Hello World";
var substring = "Hello";
if (string.indexOf(substring) != -1) {
  //Code here
}
Source

Also in JavaScript: