---
id: 6999b0198d18d402c36cc5fe
title: Step 10
challengeType: 1
dashedName: step-10
---

# --description--

In this step, you will create a function that removes a property from an object.

Here is an example of removing a property using `delete`:

```js
const bird = {
  species: "Parrot",
  canFly: true
};

const removeFlight = (pet) => {
  delete pet.canFly; // remove property using delete keyword
  return pet; // return the updated object
};

console.log(removeFlight(bird));
// { species: "Parrot" }
```

In this example, the `canFly` property is removed from the `bird` object.

Now create a function called `removeEndangeredStatus`. The function should take one parameter named `animal`.

Inside the function, remove the `isEndangered` property from the `animal` object using the `delete` keyword. Return the updated `animal` object.

After creating the function, use `console.log` to call `removeEndangeredStatus(tiger)` so you can see the updated object in the console.

# --hints--

You should create a function named `removeEndangeredStatus`.

```js
assert.isFunction(removeEndangeredStatus);
```

The `removeEndangeredStatus` function should have a single parameter, `animal`.

```js
const regex = __helpers.functionRegex('removeEndangeredStatus', ['animal']);
assert.match(__helpers.removeJSComments(code), regex);
```

The `removeEndangeredStatus` function should return the updated `animal` object.

```js
const testAnimal = { species: "Cat", isEndangered: true };
const result = removeEndangeredStatus(testAnimal);
assert.strictEqual(result, testAnimal);
```

`removeEndangeredStatus` should use the `delete` keyword to remove the `isEndangered` property.

```js
assert.match(code, /delete\s+animal\.isEndangered/);
```

You should log `removeEndangeredStatus(tiger)` to the console.

```js
assert.match(code, /console\s*\.\s*log\s*\(\s*removeEndangeredStatus\s*\(\s*tiger\s*\)\s*\)/);
```

Calling `removeEndangeredStatus(tiger)` should remove the `isEndangered` property.

```js
const updatedTiger = removeEndangeredStatus(tiger);

assert.notProperty(updatedTiger, "isEndangered");
```

`removeEndangeredStatus` should use the function parameters and work with any object.

```js
const lion = {
  species: "Lion",
  age: 4,
  isEndangered: true
};

const updatedLion = removeEndangeredStatus(lion);

assert.notProperty(updatedLion, "isEndangered");
```

# --seed--

## --seed-contents--

```js
const tiger = {
  species: "Tiger",
  age: 5,
  isEndangered: true
};

const elephant = {
  species: "Elephant",
  age: 10,
  isEndangered: true
};

const getSpecies = (animal) => {
  return animal.species;
};

console.log(getSpecies(tiger));

const getAge = (animal) => {
  return animal.age;
};

console.log(getAge(tiger));

const addHabitat = (animal, habitat) => {
  animal.habitat = habitat;
  return animal;
};

console.log(addHabitat(tiger, "Rainforest"));

const updateAge = (animal, newAge) => {
  animal.age = newAge;
  return animal;
};

console.log(updateAge(elephant, 12));

--fcc-editable-region--

--fcc-editable-region--
```
