From 88b9e846ac5dc559f7d06e5e38f39816d5a83e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=9F=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=D1=88=D0=B8=D0=BD?= Date: Sat, 19 Oct 2019 21:41:37 +0500 Subject: [PATCH] Update examples-4-function.js --- ecma5/examples-4-function.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) 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 );