function first(array){
return first(0);
var first = ["gold","brown","green"21,1998];
console.log(first[0]);
尝试创建一个函数,它将返回给定数组的第一个对象,并且收到错误self [e.data.invoke.func] .apply不是函数 不确定我错过了什么?
答案 0 :(得分:1)
我试过这个并且有效
function firstObject(array){
return array[0];
}
var first = ["Weresquirrel", "Werebear", "Werepanda", "Weremonkey"];
console.log(firstObject(first));