How do you draw a rectangle and a triangle with JavaScript?