From: Chris Rebert Date: Tue, 1 Dec 2015 07:47:56 +0000 (-0800) Subject: util.js: Add comment explaining ~~ trick X-Git-Tag: v4.0.0-alpha.2~69^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18391%2Fhead;p=thirdparty%2Fbootstrap.git util.js: Add comment explaining ~~ trick [skip sauce] [skip validator] --- diff --git a/js/src/util.js b/js/src/util.js index f4a584125f..fccf6178cc 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -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 },