function convertToInteger(str) {
var conversor = parseInt(str, 2);
return conversor;
}
convertToInteger("10011");
const ratingValue = userInput.value;
if(+ratingValue > 1) {} // + works exactly like a parseInt()
if(parseInt(ratingValue > 1)) {}
function convertToInteger(str) {
return parseInt(str);
}
convertToInteger("56");
function convertToInterger(myString) {
return parseInt(myString, 2); // We convert this to base 2.
}
console.log(convertToInterger("10011")); // This is a binary number.