mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-17 19:06:40 +02:00
util.js: Add comment explaining ~~ trick
[skip sauce] [skip validator]
This commit is contained in:
@@ -99,7 +99,7 @@ const Util = (($) => {
|
|||||||
|
|
||||||
getUID(prefix) {
|
getUID(prefix) {
|
||||||
do {
|
do {
|
||||||
prefix += ~~(Math.random() * 1000000)
|
prefix += ~~(Math.random() * 1000000) // "~~" acts like a faster Math.floor() here
|
||||||
} while (document.getElementById(prefix))
|
} while (document.getElementById(prefix))
|
||||||
return prefix
|
return prefix
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user