Hi. What am I doing wrong?
Where am I wrong?
'use strict';
var convertBase = function () {
function convertBase(baseFrom, baseTo) {
return function (num) {
return parseInt(num, baseFrom).toString(baseTo);
};
}
// hexadecimal to binary
convertBase.hex2bin = convertBase(16, 2);
return convertBase;
}();
var newMsg = convertBase.hex2bin('ff'); // '11111000'
return newMsg;
Writes an error "Function tried to send a message of type string"
They need a string. How to do it?
Thank you.