Google Apps Script: concat specific values ​​in the loop and paste them into a new sheet based on the name of the source sheet

With the code I tried so far, I wonder if anyone has an idea of ​​how to traverse an array of cell values, merge specific values ​​from a small number of columns and then copy and paste the values ​​into another sheet if the name of the sheet matches the header For example:

I want to be able to copy all the columns of the "Provider A" sheet to Sheet 2 as the screenshot. I thought this would need a loop, but since I'm a newbie and I'm still learning the Google Apps script, it would be great to get some advice. Thanks in advance!

var ss = SpreadsheetApp.getActiveSpreadsheet ();
var source = ss.getSheetByName (& # 39; VendorA & # 39;); // source sheet
var target = ss.getSheetByName (& # 39; Sheet2 & # 39;); // target sheet

recordChanges () {function

var range = source.getRange ("A1: D2");
the values ​​of var = range.getValues ​​();
target.getRange (target.getLastRow () + 1, 1, values.length, values[0].length) .setValues ​​(values);