prefix İf scope içinde olduğundan dışardan erişemiyor olmanız muhtemel
try it
let prefix = !result ? ayarlar.prefix : result.prefix;
console.log( prefix );