How do I create a function that accepts EITHER vector3 OR three floats?

I would like to create a function (in JS) that will EITHER accept a vector3 OR three floats (and then make them into a vector3)... so that either of the following will work:

v = Vector3(1,2,3);
result = MyFunction( v );

x = 1;
y = 2;
z = 3;
result = MyFunction( x, y, z );

use overloading - define two versions of a function:

Vector3 MyFunction( float x, float y, float z )
{
    // ...
}

Vector3 MyFunction( Vector3 vec )
{
     return MyFunction( vec.x, vec.y, vec.z );
}