The most common solution I encountered is using the Math.random
function to generate an extra-long number. However, the downside is that the ID might be duplicated, even though the chance seems slim.
A far better approach is to use the self.crypto.randomUUID
function to generate a randomized ID.