Box 2d moving left and right only

I would like to make a box 2d moving just left and right, please send the code in java script, thank you

Rather than asking for code, I’d recommend watching the ‘2D Game Development Walkthrough’ videos here: https://unity3d.com/learn/tutorials/modules/beginner/2d/2d-overview