DONT ADD ANYTHING HERE!

Code

JavaScript

    const canvas = document.getElementById("canvas_one")
    let ctx = canvas.getContext("2d")

//--filled triangle
    ctx.beginPath();
    ctx.moveTo(75, 25);
    ctx.lineTo(125, 75);
    ctx.lineTo(25, 75);
    ctx.fillStyle = "red";
    ctx.fill();
    ctx.closePath();

//--blue line of triangle
    ctx.beginPath();
    ctx.moveTo(175, 75)
    ctx.lineTo(275, 75)
    ctx.strokeStyle = "Blue"
    ctx.lineWidth = "3"
    ctx.stroke();
    ctx.closePath;

//--green line of triangle
    ctx.beginPath();
    ctx.moveTo(275, 75)
    ctx.strokeStyle = "Green"
    ctx.lineTo(225, 125);
    ctx.stroke();
    ctx.closePath();

//--red line of triangle
    ctx.beginPath();
    ctx.moveTo(225, 125);
    ctx.lineTo(175, 75);
    ctx.strokeStyle = "red";
    ctx.stroke();
    ctx.closePath() 

HTML

    <canvas id="canvas_one"></canvas> 

CSS

    canvas {
        background-color: lightgoldenrodyellow;
    } 

Commands

  1. getContext('2d')
  2. beginPath()
  3. closePath()
  4. fill()
  5. stroke()
  6. moveTo(x, y)
  7. lineTo(x, y)
  8. fillStyle = "red"
  9. strokeStyle = "Green"
  10. lineWidth = "3"

References