How to use xrSupportCallback()?

Can you should me a sample usage of xrSupportCallback ()?

WL.onXRSupported.push((mode, supported) => {
    console.log(mode, (supported ? "is" : "is not"), "supported");
});

Will print:

vr is supported
ar is not supported

On Oculus Quest for example