navigator.contactsPhoneNumbers access a variable

Hello together

Can someone tell me how I can access a variable that I defined on top of my script?

See example:

public my_variable = ;

constructor(…

getContacts(){
navigator.contactsPhoneNumbers.list(function(contacts) {
console.log(contacts.length + ’ contacts found’);
for(var i = 0; i < contacts.length; i++) {
console.log(contacts[i].id + " - " + contacts[i].displayName);
for(var j = 0; j < contacts[i].phoneNumbers.length; j++) {
var phone = contacts[i].phoneNumbers[j];
// here is the problem: null is not an object this.my_variable
this.my_variable.push(phone.number);
}
}
}, function(error) {
console.error(error);
});
}

Thank you so much for your help.

Cheers