Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/object/index.ts>isPlainObject

A JavaScript extension package for building strong and modern applications.
Latest
function isPlainObject
import { isPlainObject } from "https://deno.land/x/ayonli_jsext@v0.9.72/object/index.ts";

Returns true is the given value is a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null.

Examples

Example 1

import { isPlainObject } from "@ayonli/jsext/object";

console.log(isPlainObject({ foo: "bar" })); // true
console.log(isPlainObject(Object.create(null))); // true
console.log(isPlainObject(new Map([["foo", "bar"]]))); // false

Parameters

value: unknown

Returns

value is { [x: string | symbol]: any; }