How to pass a component to a javascript function?

What’s the goal here - what do you want to do with the component? The component itself is a Python object, so not directly manipulable from Javascript.