diff --git a/ecma5/examples-4-function.js b/ecma5/examples-4-function.js index ebfa55a..57fa8b9 100644 --- a/ecma5/examples-4-function.js +++ b/ecma5/examples-4-function.js @@ -1,15 +1,15 @@ var animal = { - canRun: true - }, - Wolf = function(){ - this.name = 'Волк'; - }, - Grey = function(){ - this.color = 'Серый'; - }, - Black = function(){ - this.color = 'Черный'; - }; + canRun: true +}, +Wolf = function(){ + this.name = 'Волк'; +}, +Grey = function(){ + this.color = 'Серый'; +}, +Black = function(){ + this.color = 'Черный'; +}; Wolf.prototype = animal; @@ -19,17 +19,17 @@ Grey.prototype = wolfy; Black.prototype = wolfy; var wolfyGray = new Grey(), - wolfyBlack = new Black(); +wolfyBlack = new Black(); //------------------------------------------------------------------------------------------------ -var wolfyPrototipe = Object.getPrototipeOf( wolfyGray ); //not a worked in IE8 +var wolfyPrototype = Object.getPrototypeOf( wolfyGray ); //not a worked in IE8 -wolfyPrototipe.name = 'Пёс'; +wolfyPrototype.name = 'Пёс'; wolfyGray.hasOwnProperty('color'); // Проверяет является ли своство у обекта личным //------------------------------------------------------------------------------------------------ var car = { - color:red +color:red }; var newCar = Object.create( car ); @@ -38,11 +38,11 @@ console.log( newCar ); function inherit( proto ) { - function createObject(){}; +function createObject(){}; - createObject.prototype = ptoro; +createObject.prototype = ptoro; - return new createObject; +return new createObject; } var newCar2 = inherit( car );