How do I make the player move in two different directions at the same time?

  animation, html, javascript

I’ve been trying to test my keycode skills, and made a new pen with a ‘player’ moving.
but.. I haven’t figured out how to make the player move two different directions (for example moving diagonally). Does anyone know what is missing in my current written code?
Any help is greatly appreciated.

Here is my code so far:

https: //

(The link is dismantled, to go on the link, combine the https: to the rest)

Source: Ask Javascript Questions