Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including diff-map with all npm packages installed. Try it out:

var diffMap = require("diff-map")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

diff-map v1.0.0

Diff of 2 Maps based on Keys alone

diff-map

Find the Diff of 2 maps based on keys alone

#Install

npm install diff-map --save

#Usage

var diffMap = require('diff-map');

var map1 = { 1 : {}, 3 : {} };

var map2 = { 1 : {}, 2 : {} };

diffMap(map1, map2)

Result:

{ 3 : {} }

If you:

diffMap(map2, map1)

Result:

{ 2 : {} }
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free