I'm not sure what your intent is, but probably it should be something like this?
function getSheetSectionData(name){
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(name);
var sheetData = sheet.getDataRange().getValues();
var data = [];
for (var i = 0; i < sheetData.length; i++){
var obj = {};
obj = sheetData[i][0];
data.push(obj);
}
return data;
}
UPDATE
As @grogx noted below, creation of a temporary object appears unnecessary in this context and the sample above could be optimized to
function getSheetSectionData(name){
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(name);
var sheetData = sheet.getDataRange().getValues();
var data = [];
for (var i = 0; i < sheetData.length; i++){
data.push(sheetData[i][0]);
}
return data;
}
Which can further be shortened to
function getSheetSectionData(name){
return SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName(name)
.getDataRange()
.getValues()
.map((e) => e[0]);
}
However, we do not really know, what the original intent of the OP was. It may be the case, that that temporary object was indeed required for some sort of intermediate transformation, which was striped out from the MCVE.