ichigyou
    Preparing search index...

    Function binaryToDecimalWithoutParseInt

    • Converts a binary string to its decimal equivalent.

      Parameters

      • binary: string

        The binary string to convert.

      Returns number

      The decimal value.

      This function assumes that the input binary string is valid (contains only '0' and '1'). If an invalid binary string is provided, the result may be unexpected.

      const decimalValue = binaryToDecimalWithoutParseInt('1101');
      console.log(decimalValue); // Output: 13