kennymkchan / interview-questions-in-javascript

A mostly reasonable collection of technical software development interview questions solved in Javascript
MIT License
3.61k stars 441 forks source link

fix decimalToBinary function #15

Closed httpete-ire closed 8 years ago

httpete-ire commented 8 years ago

The current implementation of decimalToBinary only works with base 2 numbers.

Calling decimalToBinary(3) returns 1.51, it should return 111.

The fix works with any decimal number.

Nice job with the repo, some good questions to look over 👀

ghost commented 8 years ago

Thanks! This was a helpful fix :D Just started this repo, so appreciate it!