Ivan Grinkin 8 anni fa
parent
commit
a24dcf16b9
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      07ObjectsFunctionalStyle.md

+ 4 - 4
07ObjectsFunctionalStyle.md

@@ -143,7 +143,7 @@ function Person(name, surname){
     }
 
     this.getFullName = function (){
-        if ("fatherName" in person){
+        if ("fatherName" in this){
             return getFullLongName()
         }
         else {
@@ -176,7 +176,7 @@ alert(person.getFullName()) //this == person
 
     this.getFullName = function (){
 
-        if ("fatherName" in person){
+        if ("fatherName" in this){
             return getFullLongName(); //this == window или undefined в strict
         }
         else {
@@ -203,7 +203,7 @@ function Person(name, surname){
     }
 
     this.getFullName = function (){
-        if ("fatherName" in person){
+        if ("fatherName" in this){
             return getFullLongName.call(this) //передаем текущий объект person как this в getFullLongName
         }
         else {
@@ -237,7 +237,7 @@ function Person(name, surname){
     }
 
     this.getFullName = function (){
-        if ("fatherName" in person){
+        if ("fatherName" in this){
             return getFullLongName() 
         }
         else {