Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
get() は WeakMap インスタンスのメソッドで、この WeakMap 内のキーに対応する値を返します。該当するキーが存在しない場合は undefined を返します。オブジェクトの値は、コピーではなく、最初に格納されたときの参照と同じものが返されます。そのため、返されたオブジェクトに変更を行うと、その参照が保持されている場所(WeakMap の中を含む)すべてに反映されます。
この WeakMap オブジェクトから値を取得する項目のキー。オブジェクトのキーは値ではなく参照として比較されます。
この WeakMap オブジェクト内の指定されたキーに関連付けられた値です。キーが見つからなかった場合は、undefined が返されます。key がオブジェクトでも非登録シンボルでもない場合は、常に undefined を返します。
| ECMAScript® 2027 Language Specification # sec-weakmap.prototype.get |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2026年1月22日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.