Based on that function, the following seems to work.
const response = pm.response.json().contantInfo; // parse straight to the array
let IDs = response.map(obj => obj.id); // create a new flat array of just the IDs
function hasDuplicates(array) {
return (new Set(array)).size !== array.length;
}
pm.test("Check IDs are unique", () => {
pm.expect(hasDuplicates(IDs)).to.equal(false);
// or pm.expect(hasDuplicates(IDs)).to.be.false;
});