Now you can also use an arrow function:
document.getElementById('buttonLED' + id).onclick = () => { writeLED (1, 1); }