https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
So usually it does not work in the browser.
Try this in your console while not on Reddit:
fetch('https://www.reddit.com/.json')
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS