Since you mentioned you are new to this, I suggest you to print the response in console and try to debug from it.
To reach the intended element, it will help you understand about the array. Here why would you need to access āPreferredFlagā tag for getting the key.
So it should be
let key = response.@context.key;
But the special characters in the tag name will cause an error and you can try what @praveendvd mentioned.
To know more about Dot and Bracket notation for JS, Please go through this: