Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Latest commit

 

History

History
53 lines (42 loc) · 1.75 KB

erase.md

File metadata and controls

53 lines (42 loc) · 1.75 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
object Object
key String

Example

import { erase } from 'object-agent';

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

erase(foo, 'bar');

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