How do I request the prediction image in JavaScript?

I’m wondering how I can get the prediction image or as the docs say format=image in JavaScript I can only find examples for python at the moment and all the JavaScript examples don’t talk about it.