how do i draw a circle or a square in java script?
Although I am very rusty with js, I'm pretty sure you need to define the unit. For example, 200px 200px. I'm also not entirely sure you need 4 values. BTW, in your repl, it says 200 200 300 350, meaning it's literally not a rectangle. What purpose would you need a js rectangle for?
P.S. ka uses processingjs and not regular js in order to simplify coding for young people. What you learn on Khan academy is basically fake.