Object passing to function

Actually I was trying to write test case for a function changeCar(car) similar to example shown here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
I was thinking of passing myCar object and change its attributes inside function but I am unable to get how to  test a function when object needs to be passed and when return value is also object.