From 52ccdf1f0a1cee3f0659ac78e81c79dae152399b Mon Sep 17 00:00:00 2001 From: MDN Date: Wed, 23 Jun 2021 00:34:06 +0000 Subject: [CRON] sync translated content --- .../reference/global_objects/map/get/index.html | 81 ---------------------- 1 file changed, 81 deletions(-) delete mode 100644 files/zh-cn/web/javascript/reference/global_objects/map/get/index.html (limited to 'files/zh-cn/web/javascript/reference/global_objects/map/get') diff --git a/files/zh-cn/web/javascript/reference/global_objects/map/get/index.html b/files/zh-cn/web/javascript/reference/global_objects/map/get/index.html deleted file mode 100644 index 1de9947bc4..0000000000 --- a/files/zh-cn/web/javascript/reference/global_objects/map/get/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Map.prototype.get() -slug: Web/JavaScript/Reference/Global_Objects/Map/get -tags: - - ECMAScript 2015 - - JavaScript - - Map - - Method - - Prototype - - 方法 -translation_of: Web/JavaScript/Reference/Global_Objects/Map/get ---- -
{{JSRef}}
- -

get() 方法返回某个 Map 对象中的一个指定元素。

- -
{{EmbedInteractiveExample("pages/js/map-prototype-get.html")}}
- - - -

语法

- -
myMap.get(key);
- -

参数

- -
-
key
-
必须参数,也是它唯一的参数,要从目标 Map 对象中获取的元素的键。
-
- -

返回值

- -

返回一个 Map 对象中与指定键相关联的值,如果找不到这个键则返回 undefined

- -

示例

- -

使用 get 方法

- -
var myMap = new Map();
-myMap.set("bar", "foo");
-
-myMap.get("bar");  // 返回 "foo"
-myMap.get("baz");  // 返回 undefined
-
- -

规范

- - - - - - - - - - - - - - - - - - - -
规范状态备注
{{SpecName('ES2015', '#sec-map.prototype.get', 'Map.prototype.get')}}{{Spec2('ES2015')}}Initial definition.
{{SpecName('ESDraft', '#sec-map.prototype.get', 'Map.prototype.get')}}{{Spec2('ESDraft')}} 
- -

浏览器兼容性

- - - -

{{Compat("javascript.builtins.Map.get")}}

- -

参见

- - -- cgit v1.2.3-54-g00ecf