js循环抓取数组小测试 据说难倒了人

这道小测试如何写各位小侠 我知道你们一定写不出来的哈份是一个外地媳妇,被婆家看不起,虽然人设让人很可怜,但是这个角色自身也是存在一些缺点的,可以说是一个优点缺点并存的角色。

img


<!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>

<div id="demo"></div>

   <script>
       var arr=["#ff0","#0f0","#00F"];

       var template=''
       arr.map(item=>{
            template+='<hr style="background:'+item+';height:10px"/>'
       })
       document.getElementById("demo").innerHTML=template;

   </script>
</body>
</html>

img

为啥什么弱智问题都有