Matching 2 axes rotation only of 2 gameobjects

I am matching rotation of 2 gameobject around y and z axis.
In the update function, I have the following

transform.rotation.eulerAngles.y = roverPlatform.transform.rotation.eulerAngles.y;
transform.rotation.eulerAngles.z = roverPlatform.transform.rotation.eulerAngles.z;

Is there a more neat / elegant approach to this task?

A suggestion from a friend of mine from UK, Arvind. I might put the solution here in case anyone needs it.

function LateUdate() {
    transform.rotation = Quaternion.Euler(0.0f, target.transform.rotation.eulerAngles.y,  target.transform.rotation.eulerAnges.z);

Why late update? Making sure the parent will move first before update the other object. A suggested here by aldonatello.