The GetArray function is returning the var s without a value as the ajax success call has not occurred yet.
When the Ajax call is successful then the 2nd debugger line is reached.
The success part of the $.ajax call can be modified like so:
...
success: function (res) {
AjaxSuccess(res);
},
...
function AjaxSuccess(result){
m=result;
}
Hope that makes sense.