<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var arr = [100, 80, "hello", true, 100, 80, true, "hello"];
var res = arr.filter(function (v, i) {
return arr.indexOf(v) === i;
});
alert(res);
</script>
</body>
</html>
数组: 数组元素 去相同,去重!
最新推荐文章于 2024-06-12 11:59:04 发布