Screenshot of code. Highlighted section: /** @param {Data} data */ const isValid = data => typeof data === 'object' && typeof data.rowIndex === 'number' && typeof data.columnIndex === 'number' && data.rowIndex >= 0 && data.rowIndex <= rows.length-1 && data.columnIndex >= 0 && data.columnIndex <= rows[0].length-1 /** @param {Data} data */ export function onPixel (data) { if (!isValid(data)) return rows[data.rowIndex][data.columnIndex]++ if (rows[data.rowIndex][data.columnIndex] === colours.length) { rows[data.rowIndex][data.columnIndex] = 0 } this.everyone.send(kitten.html` <${Pixel} rowIndex=${data.rowIndex} columnIndex=${data.columnIndex} pixelColourIndex=${rows[data.rowIndex][data.columnIndex]} /> `) } const Pixel = ({ rowIndex, columnIndex, pixelColourIndex }) => kitten.html` <button id='pixel-${rowIndex}-${columnIndex}' aria-label='pixel-${rowIndex}-${columnIndex}' name='pixel' style='
https://s3-eu-central-1.amazonaws.com/mastodon-aral/media_attachments/files/113/817/632/065/506/801/original/610302cbc0586369.png