<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nakahashi_h</author_name>
  <author_url>https://blog.hatena.ne.jp/nakahashi_h/</author_url>
  <blog_title>websandbag ブログ</blog_title>
  <blog_url>https://blog.websandbag.com/</blog_url>
  <categories>
    <anon>javascript</anon>
  </categories>
  <description>処理の中で関数の引数の総数が定まらない場合があります。 これを可変長引数と言います。 ja.wikipedia.org 可変長引数を扱いたい場合は、追加したい要素を配列にしてしまう方法もあります。 // 指定された数字の合計値を返す function sum(args) { return args.reduce((accumulator, currentValue) =&gt; { return accumulator + currentValue; }) } // 配列を関数に渡す let args = [1, 2, 3]; console.log(sum(args)); 配列にする事で要素の数に…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.websandbag.com%2Fentry%2F2020%2F09%2F05%2F180008&quot; title=&quot;【javascript】関数で可変長引数を扱う - websandbag ブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nakahashi_h/20200630/20200630162830.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-09-05 18:00:08</published>
  <title>【javascript】関数で可変長引数を扱う</title>
  <type>rich</type>
  <url>https://blog.websandbag.com/entry/2020/09/05/180008</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
