Matlab Assign Array Elements Javascript Interview Question