To what extent is Javascript used in robots?
It wouldn't be my first choice for programming of robotics, but it's certainly doable.

Thanks to NodeJS, JavaScript (or ECMAScript as it is properly known) has broken free of the browser and is now a general programming language.

Thanks to the BeagleBone Black (and others), which runs most of its systems by default through NodeJS, including its web-based IDE, you can program the whole board with ECMAScript.

So yes, you can do robotics with ECMAScript, and there are platforms which do allow you to do robotics with ECMAScript.

Would you want to do it in a real industrial environment?

As I said - it wouldn't be my first choice.