UNPKG
tricks
Version:
github-actions (1.13.0)
latest (2.4.0)
next (2.0.2-rc.3)
2.4.0
2.3.0
2.2.0
2.1.0
2.0.2-rc.3
2.0.2-rc.2
2.0.2-rc.1
2.0.1
2.0.1-rc.1
2.0.0
2.0.0-rc.1
1.16.0
1.16.0-rc.1
1.15.1
1.15.0
1.14.0
1.13.5
1.13.4
1.13.3
1.13.2
1.13.1
1.13.0
1.12.0
1.11.1
1.11.0
1.10.1
1.10.0
1.9.3
1.9.2
1.9.1
1.8.1
1.7.3
1.7.2
1.7.1
1.7.0
1.6.6
1.6.4
1.6.2
1.6.1
1.6.0
1.5.3
1.5.2
1.5.1
1.5.0
1.4.3
1.4.2
1.4.1
1.4.0
1.3.1
1.2.1
1.1.11
1.1.10
1.1.8
1.1.7
1.1.5
1.1.0
1.0.0
ES6 modules
github.com/MrSwitch/tricks
MrSwitch/tricks
tricks
/
object
/
diffKey.js
15 lines
(14 loc)
•
247 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Return all the properties in 'a' which aren't in 'b';
export
default
(a, b)
=> {
if
(a || !b) {
const
r = {};
for
(
const
x in a) {
// is this a custom property?
if
(!(x in b)) { r[x] = a[x]; } }
return
r; }
return
a; };