Mid point of a object

I have a object with cube shape.
How to get mid point of x of that object in java script?
I have to make run another object on it.
Passing object should be exact in mid.

for cube-shaped objects the pivot point is usually the center of the object …

so you can use transform.position to get the pivot point(center) of it…