GeorgeZaharia OP was not asking how to move objects on a grid. The question was about chess.js API - the correct syntax used to promote a pawn.
if he doesn't know how to move a object on a grid, wouldn't probably know how to implement chess.js API.
... also i sort of missed the first 2 pages, was thinking this 3rd page is the 1st page ... lol my bad.. now i seen he knows how to work an array.
and since C3 now supports JS scripting
here is a full js tutorial on how to make a chess based on js
maybe it helps?
tutorial how to chess js