Question: Which one is a valid constructor function? 1 point 1 function position (x,y){ 2 this. x=x; 3 this. y=yi 4} 1 function position (x,y){ 2




![this.index = index; } birds =[]; for (var i=0;i](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4ee6ddd67a_85366f4ee6d7b3e6.jpg)

Which one is a valid constructor function? 1 point 1 function position (x,y){ 2 this. x=x; 3 this. y=yi 4} 1 function position (x,y){ 2 this. x=x; 3 this. y=y; 4 return x; 5} 1 function position () \{ 2 this. x=x 3 this y=yi 4} QUESTION 2/5 How should we create an array of birds? function bird(index) { this.index = index; } birds =[]; for (var i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
