]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
util.js: Add comment explaining ~~ trick 18391/head
authorChris Rebert <github@chrisrebert.com>
Tue, 1 Dec 2015 07:47:56 +0000 (23:47 -0800)
committerChris Rebert <github@chrisrebert.com>
Tue, 1 Dec 2015 07:47:56 +0000 (23:47 -0800)
[skip sauce]
[skip validator]

js/src/util.js

index f4a584125fe738089576a8fdfccc99c918175c89..fccf6178cc90fc53221fa2e5ecd55c3b0692e53c 100644 (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
     },