Skip to content

Instantly share code, notes, and snippets.

@cesarkohl
Created January 13, 2020 14:40
Show Gist options
  • Select an option

  • Save cesarkohl/4dd30e4abbeee0e3202ca4d3f23594d2 to your computer and use it in GitHub Desktop.

Select an option

Save cesarkohl/4dd30e4abbeee0e3202ca4d3f23594d2 to your computer and use it in GitHub Desktop.
var weakMap = new WeakMap ();
function function () {};
var object = {};
// TypeError: Invalid value used as weak map key
weakMap.set ("string", "this is a string");
weakMap.set (function, "this is a function");
weakMap.set (object, "this is an object");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment