How to generate unique random ids

Unodered
"".concat(Math.round(1e12*Math.random())).concat(Date.now())

Ordered "".concat(Date.now()).concat(Math.round(1e12*Math.random()))