mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-29 21:52: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) {
|
||||
do {
|
||||
prefix += ~~(Math.random() * 1000000)
|
||||
prefix += ~~(Math.random() * 1000000) // "~~" acts like a faster Math.floor() here
|
||||
} while (document.getElementById(prefix))
|
||||
return prefix
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user