In this code snippet, I have two arrays and I want to combine them into another array called data:
data=[];
atIndex=0;
//userInfo contains the user's name and last name:
userInfo=['Mohammad','Kermani'];
//userKnow contains the information that the user knows:
userKnow=['php','javascript'];
data[atIndex]=userInfo;
data[atIndex]=userInfo;
data[atIndex]=userKnow;
//I intend to send the data using JSON and decode it with PHP:
console.log(data);
However, only the last data is stored in the data array.
It appears that it might be a nested array or two-dimensional array.