<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[JavaScriptの特徴]]></title><description><![CDATA[<p></p><p style="margin-bottom:1.4em;padding:0px">Javascriptは、ほかの言語と比べると、以下のような特徴を持っております。</p>
<h3 class="sectionedit10" id="完全なオブジェクトベース" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:1.125em;margin:0px 0px 0.888em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">完全なオブジェクトベース</h3>
<p style="margin-bottom:1.4em;padding:0px">JavaScriptでは、数値や文字列、配列、関数などのデータはすべてオブジェクトです。例えばStringオブジェクトは文字列の長さを返すlengthというプロパティを持っていますので、“Hi,world!”.lengthを参照すると、 9がリターン値になります。 
<br />JavaScriptのオブジェクトは、単純に言うと「キーと値のペアの集合」です。ですので、これは一般的なプログラミング言語でよくあった連想配列の性質を持っていると言えます。</p>
<h3 class="sectionedit11" id="プロトタイプを使ったオブジェクト指向" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:1.125em;margin:0px 0px 0.888em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">プロトタイプを使ったオブジェクト指向</h3>
<p style="margin-bottom:1.4em;padding:0px">Java や C++ といったクラスベースのオブジェクト指向言語はクラスとインスタンスという、2つの異なる実体があるという概念に基づいています。 
<br />クラスはあるオブジェクトの集合を特徴付けるすべてのプロパティ（Java ではメソッドとフィールドを、C++ ではメンバをプロパティと見なす）を定義します。 
<br />クラスとはそれが表すオブジェクトの集合という抽象的なものです、例えば、Employeeクラスは従業員すべてを含む集合を現します。 
<br />一方、インスタンスはクラスを実例にしたものです、例えば、Victoriaさんは、Employeeクラスのインスタンスとなることができます。</p><p style="margin-bottom:1.4em;padding:0px">JavaScriptのオブジェクト指向は、プロトタイプを利用しています。クラス/インスタンスの区別がなく、単にオブジェクトがあるだけです。但し、原型的なオブジェクトという概念がありまして、このオブジェクトは新しいオブジェクトの初期プロパティを取得する元になるテンプレートとして使用されます。 
<br />どのオブジェクトも、作成時にも実行時にもそれ独自のプロパティを指定できます。さらに、どのオブジェクトも別のオブジェクトに対するプロトタイプとして関連付けることができます。</p>
<h3 class="sectionedit12" id="関数型プログラミングの一部サポート" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:1.125em;margin:0px 0px 0.888em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">関数型プログラミングの一部サポート</h3>
<p style="margin-bottom:1.4em;padding:0px">JavaScriptでは関数型言語の一部の機能が備わっています。関数型言語それ自体は難しいかも知れませんが、JavaScriptで関数型を考えるにあたっては、下記三点を抑えられればよいです。</p><ul style="margin-right:0px;margin-bottom:1.4em;margin-left:0px;padding:0px 0px 0px 1.5em;list-style:square outside"><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">すべての関数が値を返す</li><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">関数に副作用がない（参照透過）</li><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">関数を値として扱える</li></ul>
<h4 id="すべての関数が値を返す" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:14px;margin:0px 0px 1em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">すべての関数が値を返す</h4>
<p style="margin-bottom:1.4em;padding:0px">すべての関数は値を返します、明示的な実装がなければ、返却値はundefinedになります。</p>
<h4 id="関数に副作用がない" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:14px;margin:0px 0px 1em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">関数に副作用がない</h4>
<p style="margin-bottom:1.4em;padding:0px">簡単に考えると、下記2点となります。</p><ul style="margin-right:0px;margin-bottom:1.4em;margin-left:0px;padding:0px 0px 0px 1.5em;list-style:square outside"><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">関数は外側の変数を変更しない</li><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">参照渡しの引数の値を変更しない</li></ul>
<h4 id="関数が値として扱える" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:14px;margin:0px 0px 1em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">関数が値として扱える</h4>
<p style="margin-bottom:1.4em;padding:0px">関数が値として扱えるので引数に関数を渡して処理を委譲、もしくは、関数を返り値として処理を委譲する事もできます。 <br />
これらの関数を高階関数と言います。 
<br />さらに、関数は、すべてクロージャであり、定義された時の環境への参照をもっているため、クロージャの性質を利用して、JavaSript固有のざまざまなカプセル仕組みを実現することができます。</p><p style="margin-bottom:1.4em;padding:0px">JavaScriptはよく、「少ないソースコードで高機能のロジックを簡潔に実現できる」プログラミング言語として高く評価されていますが、これは、ほとんどこの関数のパワーからできているものと考えれます。</p>]]></description><link>http://www.isummary.jp/topic/23/javascriptの特徴</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 05:49:51 GMT</lastBuildDate><atom:link href="http://www.isummary.jp/topic/23.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 29 Jun 2019 07:34:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to JavaScriptの特徴 on Sat, 29 Jun 2019 07:34:32 GMT]]></title><description><![CDATA[<p></p><p style="margin-bottom:1.4em;padding:0px">Javascriptは、ほかの言語と比べると、以下のような特徴を持っております。</p>
<h3 class="sectionedit10" id="完全なオブジェクトベース" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:1.125em;margin:0px 0px 0.888em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">完全なオブジェクトベース</h3>
<p style="margin-bottom:1.4em;padding:0px">JavaScriptでは、数値や文字列、配列、関数などのデータはすべてオブジェクトです。例えばStringオブジェクトは文字列の長さを返すlengthというプロパティを持っていますので、“Hi,world!”.lengthを参照すると、 9がリターン値になります。 
<br />JavaScriptのオブジェクトは、単純に言うと「キーと値のペアの集合」です。ですので、これは一般的なプログラミング言語でよくあった連想配列の性質を持っていると言えます。</p>
<h3 class="sectionedit11" id="プロトタイプを使ったオブジェクト指向" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:1.125em;margin:0px 0px 0.888em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">プロトタイプを使ったオブジェクト指向</h3>
<p style="margin-bottom:1.4em;padding:0px">Java や C++ といったクラスベースのオブジェクト指向言語はクラスとインスタンスという、2つの異なる実体があるという概念に基づいています。 
<br />クラスはあるオブジェクトの集合を特徴付けるすべてのプロパティ（Java ではメソッドとフィールドを、C++ ではメンバをプロパティと見なす）を定義します。 
<br />クラスとはそれが表すオブジェクトの集合という抽象的なものです、例えば、Employeeクラスは従業員すべてを含む集合を現します。 
<br />一方、インスタンスはクラスを実例にしたものです、例えば、Victoriaさんは、Employeeクラスのインスタンスとなることができます。</p><p style="margin-bottom:1.4em;padding:0px">JavaScriptのオブジェクト指向は、プロトタイプを利用しています。クラス/インスタンスの区別がなく、単にオブジェクトがあるだけです。但し、原型的なオブジェクトという概念がありまして、このオブジェクトは新しいオブジェクトの初期プロパティを取得する元になるテンプレートとして使用されます。 
<br />どのオブジェクトも、作成時にも実行時にもそれ独自のプロパティを指定できます。さらに、どのオブジェクトも別のオブジェクトに対するプロトタイプとして関連付けることができます。</p>
<h3 class="sectionedit12" id="関数型プログラミングの一部サポート" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:1.125em;margin:0px 0px 0.888em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">関数型プログラミングの一部サポート</h3>
<p style="margin-bottom:1.4em;padding:0px">JavaScriptでは関数型言語の一部の機能が備わっています。関数型言語それ自体は難しいかも知れませんが、JavaScriptで関数型を考えるにあたっては、下記三点を抑えられればよいです。</p><ul style="margin-right:0px;margin-bottom:1.4em;margin-left:0px;padding:0px 0px 0px 1.5em;list-style:square outside"><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">すべての関数が値を返す</li><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">関数に副作用がない（参照透過）</li><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">関数を値として扱える</li></ul>
<h4 id="すべての関数が値を返す" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:14px;margin:0px 0px 1em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">すべての関数が値を返す</h4>
<p style="margin-bottom:1.4em;padding:0px">すべての関数は値を返します、明示的な実装がなければ、返却値はundefinedになります。</p>
<h4 id="関数に副作用がない" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:14px;margin:0px 0px 1em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">関数に副作用がない</h4>
<p style="margin-bottom:1.4em;padding:0px">簡単に考えると、下記2点となります。</p><ul style="margin-right:0px;margin-bottom:1.4em;margin-left:0px;padding:0px 0px 0px 1.5em;list-style:square outside"><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">関数は外側の変数を変更しない</li><li class="level1" style="padding:0px;margin:0px 0px 0px 1.5em;color:rgb(153, 153, 153)">参照渡しの引数の値を変更しない</li></ul>
<h4 id="関数が値として扱える" style="font-weight:bold;padding:0px;line-height:1.2;clear:left;font-size:14px;margin:0px 0px 1em;color:rgb(51, 51, 51);font-family:Arial, sans-serif">関数が値として扱える</h4>
<p style="margin-bottom:1.4em;padding:0px">関数が値として扱えるので引数に関数を渡して処理を委譲、もしくは、関数を返り値として処理を委譲する事もできます。 <br />
これらの関数を高階関数と言います。 
<br />さらに、関数は、すべてクロージャであり、定義された時の環境への参照をもっているため、クロージャの性質を利用して、JavaSript固有のざまざまなカプセル仕組みを実現することができます。</p><p style="margin-bottom:1.4em;padding:0px">JavaScriptはよく、「少ないソースコードで高機能のロジックを簡潔に実現できる」プログラミング言語として高く評価されていますが、これは、ほとんどこの関数のパワーからできているものと考えれます。</p>]]></description><link>http://www.isummary.jp/post/23</link><guid isPermaLink="true">http://www.isummary.jp/post/23</guid><dc:creator><![CDATA[峯文]]></dc:creator><pubDate>Sat, 29 Jun 2019 07:34:32 GMT</pubDate></item></channel></rss>