Can The Layer An Object Is On Be Changed?

I want to know if I can have an object and change which layer it’s with Code.

This might help you: