{"provider_name":"Hatena Blog","type":"rich","author_url":"https://blog.hatena.ne.jp/olj611/","description":"\u306f\u3058\u3081\u306b \u914d\u5217\u306e\u8981\u7d20\u3092\u30b3\u30d4\u30fc\u3059\u308b\u95a2\u6570\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002 \u3084\u308a\u305f\u3044\u3053\u3068\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059\u3002 const r = f([1, 2, 3], 3); console.log(r); // [1, 2, 3, 1, 2, 3, 1, 2, 3] \u5b9f\u88c5 \u306a\u3093\u3068\u306a\u304f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5b9f\u88c5\u306b\u3057\u307e\u3057\u305f\u3002 const f = (a, n) => (new Array(n).fill(0)).reduce(p => p.concat(a), []); \u89e3\u8aac\u3057\u307e\u3059\u3002 Array \u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b number \u578b\u306e\u5f15\u6570\u3092 1 \u3064\u4e0e\u3048\u308b\u3068\u3001\u305d\u306e\u8981\u7d20\u304c undefined \u3067\u6307\u5b9a\u30b5\u30a4\u30ba\u306e\u914d\u5217\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002 \u8981\u7d20\u304c unde\u2026","version":"1.0","blog_url":"https://olj611.hatenablog.com/","width":"100%","categories":["JavaScript"],"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Folj611.hatenablog.com%2Fentry%2F2024%2F04%2F04%2F012528\" title=\"\u3010JavaScript\u3011\u914d\u5217\u306e\u8981\u7d20\u3092n\u56de\u30b3\u30d4\u30fc\u3059\u308b\u95a2\u6570 - \u6a5f\u68b0\u5b66\u7fd2\u57fa\u790e\u7406\u8ad6\u72ec\u7fd2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","published":"2024-04-04 01:25:28","provider_url":"https://hatena.blog","author_name":"olj611","blog_title":"\u6a5f\u68b0\u5b66\u7fd2\u57fa\u790e\u7406\u8ad6\u72ec\u7fd2","image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/o/olj611/20240404/20240404012412.png","title":"\u3010JavaScript\u3011\u914d\u5217\u306e\u8981\u7d20\u3092n\u56de\u30b3\u30d4\u30fc\u3059\u308b\u95a2\u6570","url":"https://olj611.hatenablog.com/entry/2024/04/04/012528"}