Google app scripts | How to perform custom ‘query’

I was wondering if we could perform a custom function in google app scripts.

For example i would like to get the result of ‘=MATCH(“A”; “A”; 0)’.
Until now i have :

const activeSpreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = activeSpreadsheet.getSheetByName("temporarySheet");
var cellData = '=MATCH("A"; "A"; 0)';
sheet.getRange('A1').setValue(cellData);
var result = sheet.getRange('A1').getValues();

And i would like:

var resultOfMatch = ANYFUNCTION('MATCH("A", "A"; 0)');

Thanks for your time.