text: // Example
  // show specific keyCodes in the console
  // const keyPressed = (evt) => {
  //     console.log(evt.keyCode)
  // }
  
  // const keyPressed = (evt) => {
  //     console.log(evt.keyCode)
  //     if (evt.keyCode == 38) {
  //         console.log("up")
  //     }
  // }
  
  // const keyPressed = (evt) => {
  //     console.log(evt.keyCode)
  //     if (evt.keyCode == 38) {
  //         console.log("up")
  //     } else {
  //         console.log("keyCode binding is not defined")
  //     }
  // }
  
  // const keyPressed = (evt) => {
  //     console.log(evt.keyCode)
  //     if (evt.keyCode == 38) {
  //         console.log("up")
  //     } else if (evt.keyCode == 40) {
  //         console.log("down")
  //     } else {
  //         console.log("keyCode binding is not defined")
  //     }
  // }
  
  // Exercise
  // find out the keyCodes for left and right. Implement those cases into the keyPressed function.
  
  // Example
  // draw updated rectangle on every key stroke
  
  // init rect with global values
  let rectX = 50
  let rectY = 50
  let sideLength = 50
  drawRect(rectX, rectY, sideLength, sideLength, "red")
  
  // function for key bindings
  const keyPressed = (evt) => {
    // evt.preventDefault()
    console.log(evt.keyCode)
    // drawRect(0, 0, canvas.width, canvas.height, "black")
    // resetCanvasToBlack()
    // up
    if (evt.keyCode == 38) {
      rectY -= 1
    }
    // left
    else if (evt.keyCode == 37) {
      rectX -= 1
    }
    // right
    else if (evt.keyCode == 39) {
      rectX += 1
    }
    //down
    else if (evt.keyCode == 40) {
      rectY += 1
    }
    // +
    else if (evt.keyCode == 187) {
      sideLength += 1
    }
    // +
    else if (evt.keyCode == 189) {
      sideLength -= 1
    }
    else {
      console.log("keyCode binding is not defined")
    }
    // draw updated rectangle with updated parameters
    drawRect(rectX, rectY, sideLength, sideLength, "red")
  }
  
  document.addEventListener('keydown', keyPressed)
  
  
  // Exercise
  // refactor the function, bind the keys r,g,b to changing the color to red, green and blue
  
  // Exercise
  // expand the keyPressed function: change the color of the rectangle after to a keyStroke (e.g. "blue" if keyCode = 40)