How to create a transaction?


I have generated three bitcoin testnet addresses: first one is to send from, second one is to receive and the third one is the address I would like to send left coins from first address.

const wif = 'cN6NEm1BfGYf8vwdbEHXtt9sUE92PD7JBnTqBAMQPuReBej5xi5b';
const privateKey = bitcore.PrivateKey.fromWIF(wif);
// Create a public key
const publicKey = new bitcore.PublicKey(privateKey);
// Generate Address
const address1 = privateKey.toAddress(); // Balance: BTC 2.9
// Log out address

// ============= SECOND ADDRESS ============
// Generate second address for testing purpose
const wif2 = 'cVtGbC6xQfUvF6yRL2fn8XAK9u67VzkDV8VJdWbCjL5p5M1AHdcj';
const privateKey2 = bitcore.PrivateKey.fromWIF(wif2);
const address2 = privateKey2.toAddress();

// ============= THIRD ADDRESS =============
const wif3 = 'cTLKQwLYQVGMNoGUA1YSmKGAAVmhjCWxqn9vamM9k4YDC9ct2DKe';
const privateKey3 = bitcore.PrivateKey.fromWIF(wif3);
const address3 = privateKey3.toAddress();

const transaction = new bitcore.Transaction()
  .to('mr3mEZdm7Qx1ZKEtawKYBZRG3TUeSwwgm3', 1)

Actually I think that documentation should be much better explained, but never mind. Can someone explain me how to make a simple transaction and also from where to get txId ?
Thanks in advance.