js 引入lodash.js调用其方法demo 例子

<html>
   <head>
      <title>Lodash-Working Example</title>
      <script type = "text/JavaScript" src = "https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script>
      <style>
         div {
            border: solid 1px #ccc;
            padding:10px;
            font-family: "Segoe UI",Arial,sans-serif;
            width: 50%;
         }
      </style>
   </head>
   <body>
      <div style = "font-size:25px" id = "list"></div>
      <script type = "text/JavaScript">
      // 去重
const arr = [1, 1, 2, 3, 3, 4, 5];
console.log(_.uniq(arr)); // [1, 2, 3, 4, 5]
      </script>
   </body>
</html>

你可能感兴趣的:(javascript,chrome,前端)