+ 1
Please why can't I call person() in line 19 of the code named remove inner object
An unknown function they say it is but I tried it in the other code named global variable accessed from inside and it worked https://code.sololearn.com/WYhL5awtmEuj/?ref=app https://code.sololearn.com/W9NqzL3q1xWp/?ref=app
10 odpowiedzi
+ 2
Can you describe to me, what was your actual intention with this code? cause I'm not getting any ideas ...
I mean, what you want the code to do, briefly.
+ 3
Yes I see, but in "Global variable" code, the `Drive` function does not construct an object, neither does it return an object with attributes or methods, the way `person` function does ...
`Drive` simply log value of <Break> variable which resides outside the function, much simpler one by functionality I guess, compared to `person`.
+ 2
Sorry, did you mean to call `person()` just like that, but what was the point for calling just `person()`
Where you learn this, in SoloLearn? other place? I'd like to see it so I can understand the actual intention of the code better.
+ 2
No problem bro 👌
+ 1
Thanks for the explanation..I appreciate
+ 1
Thanks all for the answer on the code I named return inner object..Went back to go do some research and found out it was an IIFE, immediately invoked function expression used in the modular pattern of encapsulation in OOP Javascript.
0
Ok I was studying encapsulation and copied it..What I want to know is about the function call on line 19.
Why is it that if I type person() it gives an error ?.
0
Ok try accessing the code I named Global variable accesed from inside to understand what I'm saying.
0
It is basically data validation code .I was just wondering why I can't type person().if I type person() it returns error, but did it in the code named Global variable accessed from inside and it worked
https://code.sololearn.com/W9NqzL3q1xWp/?ref=app
0
Thanks