-2

What function or method converts number (2354) to binary code (001011001010)? Thanks

1
  • Unclear how you get the zeroes at the start of your binary version. Also, idownvotedbecau.se/noresearch Commented Nov 26, 2019 at 16:22

1 Answer 1

1

try this :

number= 2345
binary = number.toString(2)
console.log(binary)

the result of this code is : 100100101001

btw : 001011001010 in binary is equal to 714 in decimal ;) https://www.rapidtables.com/convert/number/binary-to-decimal.html

Sign up to request clarification or add additional context in comments.

2 Comments

Please don't answer questions that have been asked many times before. We mark them as duplicate so all the good and up-to-date content stays in one place.
Thanks. Yeah, I've found the answer. Not good start for me in asking. Now trying to ask "is any analog of jquery.bacstretch in react" but I can't because of questions limit(

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.