JavaScript 中 Map.set() 函数
Map 对象的 set() 函数将元素(键值对)添加到 Map 对象或更新元素(键值对)。
语法
其语法如下
mapVar.set()
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var mapVar = new Map();
mapVar.set('1', 'Java');
mapVar.set('2', 'JavaFX');
mapVar.set('3', 'HBase');
mapVar.set('4', 'Neo4j');
document.write(mapVar.has('3'));
</script>
</body>
</html>输出
true
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
JavaScript
PHP