You're confusing variables/methods/values and would probably benefit from reading
a starting guide.
You will have to do the same thing for the arrow keys, either using their 'code' value, or ideally using keydown (so that it uses the key configured by players in the options).
This is obviously not going to work:
PHP Code:
this.(keydown(3))
because keydown(3) gets evaluated into either 1 or 0, and then it's checking the value of either this.1 or this.0, which doesn't make any sense.
Instead you'll want to keep track of when the direction keys are pressed.