zoukankan      html  css  js  c++  java
  • 数组去重.html

    <head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
    *{
    margin-top: 10px;

    box-sizing: border-box;
    }
    span{
    display:inline;
    200px;
    height: 50px;
    border: dashed red 2px;
    }
    span:hover{
    background-color: pink;
    border: yellow outset 2px ;
    border-radius: 20px;
    color: red;
    }
    </style>
    </head>
    <body>
    <div style=" 500px;height: 100px;background-color: rgba(233,56,48,.2);padding: 20px 0 0 10px;">

    <script type="text/javascript">
    //数组去重

    function newarr(arr)
    {
    return Array.from(new Set(arr))
    }
    var arr=[23,5,67,25,26,5,899,26,24,23,899,5,67,9,25];
    document.writeln('<span>去重前的数组:'+arr+'</span></p>')
    document.writeln('<span>去重后的数组:'+newarr(arr)+'</span>')
    </script>
    </div>
    </body>

  • 相关阅读:
    bzoj 1977
    bzoj 3389
    bzoj 1064
    codeforces 424D
    codeforces 425C
    codeforces 425D
    codeforces 427E
    codeforces 425E
    codeforces 429D
    codeforces 429E
  • 原文地址:https://www.cnblogs.com/d534/p/12868253.html
Copyright © 2011-2022 走看看