chess.js
chess.js copied to clipboard
about promotion default value
trafficstars
Hi, I wonder what is the default value of move.promotion? Can I decide whether the current move is a promotion by checking whether promotion === ''?
You can check the flags property on the move object: https://github.com/jhlywa/chess.js#moves-options-
const isPromotion = move.flags.includes('p')
Thanks for your response! I have read the doc, am I able to check this flags only in the verbose mode, or it doesn't matter?