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

View File

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