- const L = this.epSquares.length;
- if (this.epSquares[L - 1].every(epsq => epsq === undefined)) return "-"; //no en-passant
- let res = "";
- this.epSquares[L - 1].forEach(epsq => {
- if (epsq) res += V.CoordsToSquare(epsq) + ",";
- });
- return res.slice(0, -1); //remove last comma
+ return this.epSquares[this.epSquares.length - 1].map(
+ epsq => epsq === undefined
+ ? "-" //no en-passant
+ : V.CoordsToSquare(epsq)
+ ).join(",");