The Gamepad.id property of the Gamepad interface returns a string containing some information about the controller.
Gamepad.id
MDN Reference