Baseline Widely available
ÐеÑод get()
возвÑаÑÐ°ÐµÑ ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð¸Ð· обÑекÑа WeakMap,
ÐбÑзаÑелен. ÐлÑÑ ÑлеменÑа, коÑоÑÑй бÑÐ´ÐµÑ Ð²Ð¾Ð·Ð²ÑаÑÑн из обÑекÑа WeakMap.
ÐозвÑаÑÐ°ÐµÑ ÑÐ»ÐµÐ¼ÐµÐ½Ñ Ð¿Ð¾ ÑÐºÐ°Ð·Ð°Ð½Ð½Ð¾Ð¼Ñ ÐºÐ»ÑÑÑ Ð¸Ð»Ð¸ undefined, еÑли клÑÑ Ð½Ðµ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð½Ð°Ð¹Ð´ÐµÐ½ в обÑекÑе WeakMap.
ÐÑимеÑÑ ÐÑполÑзование меÑода getvar wm = new WeakMap();
wm.set(window, "foo");
wm.get(window); // ÐозвÑаÑÐ°ÐµÑ "foo".
wm.get("baz"); // ÐозвÑаÑÐ°ÐµÑ undefined.
СпеÑиÑикаÑии СовмеÑÑимоÑÑÑ Ñ Ð±ÑаÑзеÑами Firefox-specific notes
TypeError
when the key parameter was not an object. However, the latest ES6 standard specifies to return undefined
instead. Furthermore, WeakMap.prototype.get
accepted an optional second argument as a fallback value, which is not part of the standard. Both non-standard behaviors are removed in version 38 and higher (Firefox bug 1127827).RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4