Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 1.83 KB

erase.md

File metadata and controls

53 lines (42 loc) · 1.83 KB

Object Agent

A javascript library for working with objects

npm build coverage deps size vulnerabilities license


erase(object, key) ⇒ boolean

Deletes a property from an object, if the property exists.

Param Type Description
object object An object.
key string The key to delete.

Example

import { erase } from 'object-agent';

const foo = {
    bar: 1,
    also: 2
};

erase(foo, 'bar');

console.log(foo);
// => {also: 2}