javascript convert number to binary representation
// Javascript convert a number to a binary equivalent.
// Syntax: n.toString(radix)
// Note that radix in this syntax is the radix n will become.
let n = 100;
let binary = n.toString(2);
// => 1100100
// Convert a binary number to a radix of 10 equivalent.
// Syntax: parseInt(num, radix).
// Note that radix in this syntax is denoting i's current radix.
let i = 1100100;
let number = parseInt(i, 2);
// => 100
Also in JavaScript:
- javascript thread sleep
- javascript 1 + "1"
- single if statement js true false
- jest async test fetch api
- datatables clear table
- button click function in js
- Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.ts(1219) angular
- jquery add div element
- switch case in js
- how can prevent morgan to work in test enviroment
- how to code a check age function in javascript
- moment.set
- hello world in javascript
- clear terminal node js
- how to create duplicate key array in javascript
- javascript object total
- javascript date get day of week abbreviation
- useReactiveVar
- axios post with header
- javascript pad with leading zeros
- nodejs format text
- c# print object to json
- javascript find smallest number in an array
- discord.js clear code