let myArray = ["id1","id2","id3"]

let myString = "OR( RECORD_ID() = '" + myArray.join("', RECORD_ID() = '") +"')";

console.log(myString)

document.write(myString)
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.