A canvas clearRect example

function canvasReady() {
  document.body.style.backgroundColor = "#eee";
  document.getElementById('canvas').style.backgroundColor = "#008888";
  draw(document.getElementById('canvas').getContext('2d'));
}
function draw(ctx){
    ctx.translate(-10, 5);
    ctx.scale(1.2, 0.8);
    ctx.rotate(5 * Math.PI / 180);

  ctx.beginPath();
  ctx.fillStyle = "pink";
  ctx.arc(50, 50, 50, 0, Math.PI * 2, 1);
  ctx.fill();
  ctx.beginPath();

  ctx.fillStyle = "skyblue";
  ctx.arc(80, 80, 50, 0, Math.PI * 2, 1);
  ctx.fill();

  ctx.clearRect(20, 40, 60, 20);
}