Hey there, I am stuck on this problem. I hope someone can help me

Define a function called concat. The function should, when given two arrays, concatenate the arrays together.

My answer:-

```
function concat(x,y)
{
let length = x.length + y.length;
let z = [length];
let pos = 0;
for(let element of x){
z[pos]=element;
pos++;
}
for(let element of y){
z[pos]=element;
pos++;
}
return z ;
}
console.log(concat([1,2,3],[4,5,6,7])) //OUTPUT should be [1,2,3,4,5,6,7]
```

can anyone tell me what am i doing wrong and how to fix it ?