Edit in JSFiddle

const array = [5, 2, 4, 5, 3];
document.writeln([...new Set(array)]);