mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-06 04:08:22 +01:00
util.js: Add comment explaining ~~ trick
[skip sauce] [skip validator]
This commit is contained in:
parent
e458c7b0e6
commit
a887a1207c
@ -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
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user