Well, there’s ‘join’:
["#p1", "#p2", "#p3", "#p4", "#p5"].join(", ")
EDIT – Extra info:
It is possible to select an array of elements, problem is here you don’t have the elements yet, just the selector strings. Any way you slice it you’re gonna have to execute a search like .getElementById or use an actual jQuery select.