Skip to content

Check if two values are shallowly equal to each other.

License

Notifications You must be signed in to change notification settings

fabiospampinato/are-shallow-equal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Are Shallow Equal

Check if two values are shallowly equal to each other.

Install

npm install are-shallow-equal

Usage

import areShallowEqual from 'are-shallow-equal';

// Let's compare two values for shallow equality

areShallowEqual ( 123, 123 ); // true
areShallowEqual ( { foo: 1 }, { foo: 1 } ); // true
areShallowEqual ( [1, 2, 3], [1, 2, 3] ); // true

areShallowEqual ( 123, 456 ); // false
areShallowEqual ( { foo: 1 }, { foo: 2 } ); // false
areShallowEqual ( [1, 2, 3], [1, 2] ); // false

License

MIT © Fabio Spampinato

About

Check if two values are shallowly equal to each other.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published