'Correct way to pass multiple values for same parameter name in GET request in javascript or nodeJs

I wanted to write the response like this using nodeJs:

http://server/action?id=a&id=b

Or

http://server/action?id=a,b


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source