Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript check if number is a power of 2

function powerOfTwo(x) {
    return Math.log2(x) % 1 === 0;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to master javascript 
Javascript :: how convert object to string and string to object in javascript 
Javascript :: string array to int array javascript 
Javascript :: react hook toggle state 
Javascript :: javascript sort by big amount to small desc 
Javascript :: how to copy to clipboard in react js 
Javascript :: object delete with id filter javascript 
Javascript :: java password regex 
Javascript :: HashLocationStrategy 
Javascript :: keypress javascript 
Javascript :: flatten in js without lodash 
Javascript :: jquery image change on hover 
Javascript :: USA phone number validator angular 
Javascript :: shadown reAct native 
Javascript :: hide and show modal in jquery 
Javascript :: import json data in js file 
Javascript :: wait for element to load 
Javascript :: react native scrollview detect end 
Javascript :: react native elevation 
Javascript :: angular input value 
Javascript :: jquery change select option text 
Javascript :: navigating programatically react 
Javascript :: jquery visible 
Javascript :: remove div by class name javascript 
Javascript :: javascript get element position relative to document 
Javascript :: mongoose custom object schema 
Javascript :: regex any character 
Javascript :: new operator in javascript 
Javascript :: jquery each loop 
Javascript :: eas build apk 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =