By adding two lines in the do {} while (pn.Parent):
do {
pn = cn.Parent;
ds.push({
Dir: cn.Y - pn.Y !== 0 ? cn.Y - pn.Y < 0 ? AS.Direction.UP : AS.Direction.DOWN : cn.X - pn.X > 0 ? AS.Direction.RIGHT : AS.Direction.LEFT,
Node: cn});
console.log(ds.length); // Added this line,
console.log(ds); // and this one
cn = pn;
} while (pn.Parent);
I realised that the console.log(ds) was printing ds as it was after a call to GameLoop() which would call, at some point, AS.FindPAth, while console.log(ds.length) was printing ds.length as it was at the time I asked it be printed.
Since, before the end of GameLoop(), I was removing the last element of the path returned my FindPath() (nextDirection = path.pop()), console.log(ds) would print itself missing one element.
Still, javascript makes one go nut when it does things like printing the state of an object as it will be later rather than as it is at the time of the console.log()...