list map

 

 

 

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
    <script>
    let arr=[100, 98, 37, 28, 19, 96, 56, 67];
    /*let res=arr.map(function (item){
      if(item>=60){
        return true;
      }else{
        return false;
      }
    });*/
    let res=arr.map(item=>item>=60);

    console.log(arr, res);
    </script>
  </head>
  <body>

  </body>
</html>

 

posted @ 2021-02-05 23:43  AngDH  阅读(70)  评论(0编辑  收藏  举报