1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
var left = 0; var right = 0; function update(node, value){ node.setAttribute('value', value); } module.exports = { left: function(node) { left = (left + 1) % 3; update(node, left); }, right: function(node) { right = (right + 1) % 3; update(node, right); }, }