mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00

* added algo for checking the number is power of four or not * Update IsPowerofFour.js * Update IsPowerofFour.js * fix code style * used proper JSDoc comment and fixed test issues * fixed test case issue --------- Co-authored-by: madhuredra <madhuredra.tiwari@zemosolabs.com>
15 lines
321 B
JavaScript
15 lines
321 B
JavaScript
import { isPowerOfFour } from '../IsPowerofFour'
|
|
|
|
describe('IsPowerOfFour', () => {
|
|
it.each([
|
|
[0, false],
|
|
[4, true],
|
|
[16, true],
|
|
[12, false],
|
|
[64, true],
|
|
[-64, false]
|
|
])('should return the number is power of four or not', (n, expected) => {
|
|
expect(isPowerOfFour(n)).toBe(expected)
|
|
})
|
|
})
|