I have this array:
$data=[95,65,25,12,45,896,325];
I wrote the next code to javascript:
var num=data.length;
console.log(num);
console.log(data);
var arrayValue=function (){
for(var i=0;i<=num;i++){
return data[i];
}
};
console.log(arrayValue());
the problem is that it returns only the data[0]=95 value.How i can fix it?I want to post all the present values of the previous array. The console script is this
7
[95, 65, 25, 12, 45, 896, 325]
95