Move a cube from one place to other at selected speed

I am new in unity 3d. I am trying to write a Java script to move the cube from one place to other on x axis. I just want to know how to control the speed.

You have different approaches to achieve this.
The most simple one, is to translate the cube’s position:

void Update()
     transform.Translate(0.1f, 0, 0);

Where 0.1f is the speed over the X-axis

Don’t know how it’s done in Javascript. But some code in c#

transform.position += transform.right * Time.deltaTime * mul;

change the value of ‘mul’ until you get desired speed.

If the speed is slow, you can move the object, set a delay with yield, then repeat the process.