Advertisement
Guest User

This code suits well

a guest
Apr 26th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function binaryLogarithm(numbers) {
  2.     numbers = numbers.map(Number);
  3.     for (let digit of numbers) {
  4.         if (digit != 0)
  5.         console.log(Math.log2(digit))
  6.     }
  7. }
  8. binaryLogarithm(['1024', '1048576','256','1','2','50','100',0]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement