function as key of Map

node v10.16.3
version: 1.0.1
endpointsharetweet
function a() { return "abc" } function b() { return 123 } function wrap(f) { return () => f() } var wa = wrap(a) var wb = wrap(b) wa === wb
Object.is(wa, wb)
var m = new Map() m[wa] = "hello, world!" m[wb]
Loading…

no comments

    sign in to comment