Home >Web Front-end >JS Tutorial >How to use JavaScript to determine whether a number is raised to the nth power of 2

How to use JavaScript to determine whether a number is raised to the nth power of 2

黄舟
黄舟Original
2017-08-23 13:22:592296browse

When I went for an interview yesterday, the interviewer asked an interview question about how to determine whether a number is 2 raised to the nth power. I didn’t know what 2 raised to the nth power at the time (I was so embarrassed)

The above is the detailed content of How to use JavaScript to determine whether a number is raised to the nth power of 2. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn