[refactor] Moved 'powerOfTwo' to 'isPowerOfTwo' TS file

This commit is contained in:
Steven Evans
2018-07-05 14:20:21 -04:00
parent 1a5208f78f
commit 015524f049
3 changed files with 15 additions and 9 deletions
-7
View File
@@ -110,17 +110,10 @@ function compareArrays(a1, a2) {
return true;
}
//Returns bool indicating whether or not its a power of 2
function powerOfTwo(n) {
if (isNaN(n)) {return false;}
return n && (n & (n-1)) === 0;
}
export {sizeOfObject,
clearObject,
clearEventListeners,
compareArrays,
powerOfTwo,
clearEventListenersEl,
removeElement,
createAccordionElement,