JSFiddle - React, Tailwind, and code Playground
HTML
Result: <span id="result"></span>
CSS
#result {
color: #f00;
}
JavaScript
var number = 3;
var result = number.toString(2);
// In case we want to change the number directly, not
// a variable with a number value, we need to use two
// dots - it's equivalent of 14.0.toString where we can
// show that decimal part of the number is equal to 0.
var result2 = 3..toString(2);
document.getElementById('result').innerHTML = result + ', ' + result2;