smallestPowerOfTwo(), takes in an array and should return an array with the power of two which is greater than the value of each number element in the array provided as argument. For example, [5, 3, 9, 30] should return [ 8, 4, 16, 32 ].
The purpose of the project is just learning and practicing.
The function creates a new array, loop through the argument array and push in the smallest power of two which is greater than the current element.
The 'outer' for loop - loops through each element in the array.
The 'inner' while loop - searches for smallest power of 2 greater than the given number
- Try doing the same using built-in methods.
- Javascript ES6
NA - It's only coding examples, there's no setup.
Project is: finished, technically- may come back and improve it later.
Based on Codecademy's Web Development path courses, Code Challenges: Intermediate JavaScript exercises