- 3
Why
Why when we use a function like thisăfunction person (name, age) { this.name=name; this.age=age; ăă and then they used ăthis.yearofbirth=birthyear ă why name and age was set between () by function and birth year not ?
1 RĂ©ponse
0
if you declare and initialize birthyear variable in the global scope then no need to pass that variable as a parameter.you get the access of birthyear inside the function.