[Solved] function that returns first object of a given array [closed]

[ad_1]

I tried this and it worked

function firstObject(array){
     return array[0];
}

var first = ["Weresquirrel", "Werebear", "Werepanda", "Weremonkey"];

console.log(firstObject(first));

2

[ad_2]

solved function that returns first object of a given array [closed]