From a887a1207c3193a7389a4b84c22991e9a91d82a6 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 30 Nov 2015 23:47:56 -0800 Subject: [PATCH] util.js: Add comment explaining ~~ trick [skip sauce] [skip validator] --- js/src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 },