@imjano/compare_2_objects
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Compare objects

This function provides a recursive function to check if two objects are equal.

Installation

npm install @imjano/compare_2_objects

Usage

const compareObjects = require('@imjano/compare_2_objects')

const obj1 = {
	name: 'John',
	age: 30,
	address: {
		city: 'New York',
		country: 'USA',
	},
}

const obj2 = {
	name: 'John',
	age: 30,
	address: {
		city: 'New York',
		country: 'USA',
	},
}

console.log(compareObjects(obj1, obj2)) // true

Package Sidebar

Install

npm i @imjano/compare_2_objects

Weekly Downloads

7

Version

1.0.1

License

ISC

Unpacked Size

5.57 kB

Total Files

8

Last publish

Collaborators

  • imjano