0
0
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:
Chris Rebert 2015-11-30 23:47:56 -08:00
parent e458c7b0e6
commit a887a1207c

View File

@ -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
},