I'm currently working on a helper method to identify the intersection of two hashes/Objects in this manner...
Object::intersect = (obj)->
t = {}
t[k] = @[k] for k of obj
t
x = { a: 1, b: 2, c: 3 }
w = { a: true, b: 3 }
x.intersect(w) #=> { a: 1, b: 2, intersect: [Function] }
The output is as expected aside from the unexpected addition of the 'intersect' key/value.
What could I be overlooking here?