Both functions receive the same first parameter, which is the future URL of the document to be moved/copied, but the second parameter is different.
In the case of the moveTo function, it expects an enum value of type SP.MoveOperations. This parameter determines the kind of operation to execute when copying the file.
The options available for the flag value are:
The copyTo function expects a bool value that simply indicates whether the file should be overwritten or not in case the file already exist in the destination library.
If the file already exist in the destination library and the bOverWrite value is false, an error will occur while executing the instruction. The same will happen with the moveTo function when the _SP.MoveOperations.none _enum is passed as the flag parameter.
Here is a simple function that takes the parameters needed to copy or move a file.
I’ve tested this code in SharePoint 2010, SharePoint 2013 and SharePoint Online as well.
Hope you like it and find it useful.