<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/twstudy/">
    <title>仮）</title>
    <link>http://w.atwiki.jp/twstudy/</link>
    <atom:link href="https://w.atwiki.jp/twstudy/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>仮）</description>

    <dc:language>ja</dc:language>
    <dc:date>2009-08-31T03:10:11+09:00</dc:date>
    <utime>1251655811</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/twstudy/pages/14.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/twstudy/pages/2.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/twstudy/pages/1.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/twstudy/pages/14.html">
    <title>JavaScript ch. 8.6</title>
    <link>https://w.atwiki.jp/twstudy/pages/14.html</link>
    <description>
      #contents(fromhere)

**8.6 関数のプロパティとメソッド
・関数は特殊なJavaScriptオブジェクト
　→関数もプロパティやメソッドを持つ。
・typeofで調べると関数は「function」。


***8.6.1 lengthプロパティ
・argument配列のlengthプロパティはその関数に実際に渡された引数の個数を示す。
・これに対し、関数自身のlengthプロパティは関数の引数リストで宣言された引数の個数を示す。
・関数のlengthプロパティは、関数の中でも外でも使用できる。
・関数に渡された引数の個数が想定どおりの数かどうかチェックする時に使える。

    function check(args){
        var actual = args.length;
        var expected = args.callee.length;
        if( actual != expected ){
            throw new Error(&quot;Wrong number of arguments&quot;);
        }
    }
   
    function f(x, y, z){
        check(arguments);
        return x + y + z;
    }


***8.6.2 prototypeプロパティ
・どの関数にも、あらかじめ定義された プロトタイプオブジェクト を参照する prototypeプロパティ がある。
・new演算子を伴うコンストラクタとして関数を使用する場合に、プロトタイプオブジェクトが使われる。
　→prototypeプロパティについては9章で！


***8.6.3 自分専用の関数プロパティの定義
・呼び出された時に一意の識別値を返す関数（毎回異なる値を返す。）
　→過去の履歴を保持しておき、呼び出されたときにその履歴情報にアクセスする必要がある。
　→これをグローバル変数に格納することもできるが、関数の内部でしか使わない場合、関数のプロパティに格納するのが最適。

例）
    uniqueInteger.counter = 0;
      </description>
    <dc:date>2009-08-31T03:10:11+09:00</dc:date>
    <utime>1251655811</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/twstudy/pages/2.html">
    <title>menu</title>
    <link>https://w.atwiki.jp/twstudy/pages/2.html</link>
    <description>
      &amp;link_edit(text=[Edit])

*updates
#recent(20)

*bookmark
・[[MDC&gt;&gt;https://developer.mozilla.org/ja]]


&amp;link_editmenu(text=[EditMenu])    </description>
    <dc:date>2009-08-31T03:05:42+09:00</dc:date>
    <utime>1251655542</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/twstudy/pages/1.html">
    <title>top</title>
    <link>https://w.atwiki.jp/twstudy/pages/1.html</link>
    <description>
      *JavaScript 8章（後半）

#contents(page=JavaScript ch. 8.6)    </description>
    <dc:date>2009-08-31T03:09:23+09:00</dc:date>
    <utime>1251655763</utime>
  </item>
  </rdf:RDF>
