@BigAB pointed out that my Reflect example is not actually correct.
Reflect.set does not actually do the same thing as
Map.prototytpe.set when called on a
Map instance. Hopefuly this example will clarify:
var map = new Map();
Reflect.set(map, 'hello', 'universe');
Running this code ends up with
map looking like:
This shows that
Reflect.set(map, 'hello', 'universe'); is just doing
map['hello'] = 'universe'; and not correctly setting the value internally on the map.
The point that this example was trying to make was that
Reflect will smooth out APIs to work across different object types. This isn't actually true with
Reflect, but is true with
can-reflect. Although this example is bad, hopefully it still explains what
can-reflect is trying to do.