Core-js: Why is Math.random() needed for uid?

Created on 29 Feb 2020  路  1Comment  路  Source: zloirock/core-js

Using Math.random makes Prepack not work. For core-js/packages/core-js/internals/uid.js, it looks like Math.random isn't need? Isn't an unique ID enough to ensure that the returned value is unique across the application?

question

Most helpful comment

Has to be unique per each load of corejs otherwise other libraries can also use the same "unique ID" and grab the symbols

>All comments

Has to be unique per each load of corejs otherwise other libraries can also use the same "unique ID" and grab the symbols

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RedHatter picture RedHatter  路  5Comments

devongovett picture devongovett  路  4Comments

flcl42 picture flcl42  路  4Comments

ajbowler picture ajbowler  路  3Comments

mrstux picture mrstux  路  3Comments