JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<!-- この枠内は無視してください -->




































































<h4><strong><a href="http://www.oreilly.co.jp/books/9784873116211" target="_blank">開眼!JavaScript</a> サンプルコード</strong></h4>

<p>スクリプトはページロード時に実行されます。</p><p>再度実行する場合や「JavaScript」ボックス内のスクリプトを修正して実行する場合は上部のナビゲーションバーにある「Run」をクリックしてください。</p><p>アウトプットはページ右下のFirebug Liteコンソールに出力されます。</p>

<a href="http://shop.oreilly.com/product/0636920027713.do" target="_blank">原著:JavaScript Enlightenment</a>

JavaScript

var Foo = function Foo(){};
Foo.prototype = {}; // prototypeプロパティを空のオブジェクトに置き換える

var fooInstance = new Foo();
console.log( fooInstance.constructor === Foo ); // 参照が破壊されている 出力:false
console.log( fooInstance.constructor ); // 出力:Object()

// prototypeプロパティを置き換えない場合と比較

var Bar = function Bar(){};
var barInstance = new Bar();
console.log( barInstance.constructor === Bar ); // 出力:true
console.log( barInstance.constructor ); // 出力:Bar()