I have an array of coordinates:

/** * Стандартное рассположение шашек */ Checkers.prototype.coord = function() { // координаты шашек var checkers_coords = new Array(); checkers_coords['white'] = ["5.0","5.2","5.4","5.6", "6.1","6.3","6.5","6.7", "7.0","7.2","7.4","7.6"]; checkers_coords['black'] = ["0.1","0.3","0.5","0.7", "1.0","1.2","1.4","1.6", "2.1","2.3","2.5","2.7"]; return checkers_coords; } 

I am trying to send this array to the client: socket.emit ('start', game.coord ())

However, it comes up empty, although it is printed on the server as needed. Tell me please what's the problem?

Closed due to the fact that off-topic participants Dmitriy Simushev , aleksandr barakin , Vladimir Glinskikh , Visman , RussCoder Sep 13 '15 at 9:50 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Dmitriy Simushev, aleksandr barakin, Vladimir Glinskikh, Visman, RussCoder
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • And how do you send to the client? - lampa
  • socket.emit ('start', game.coord ()) - Nepster
  • problem solved: var checkers_coords = {}; - Nepster

1 answer 1

Reply from comment:

problem solved: var checkers_coords = {};