I have the following code to draw rectangle using Javascript.
I modified it to draw square. I want it to work for both rectangel and square, given an option variable: modeOption ={"rectangle", "square"}
What can be added below to make it draw both. Help!