Skip to content

Commit 42b95ed

Browse files
committed
modifying only jsdocs of BinaryToDecimal RGBToHex in Conversions folder
1 parent 53035ec commit 42b95ed

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Conversions/BinaryToDecimal.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* Converts a binary string to a decimal number.
3+
*
4+
* @param {string} binaryString - The binary string to be converted to decimal.
5+
* @returns {number} The decimal representation of the binary string.
6+
*/
17
export default function binaryToDecimal(binaryString) {
28
let decimalNumber = 0
39
const binaryDigits = binaryString.split('').reverse() // Splits the binary number into reversed single digits

Conversions/RGBToHex.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Converts RGB color values to a hexadecimal color code.
3+
*
4+
* @param {number} r - The red color value (0-255).
5+
* @param {number} g - The green color value (0-255).
6+
* @param {number} b - The blue color value (0-255).
7+
* @returns {string} The hexadecimal color code representing the RGB values.
8+
* @throws {TypeError} If any of the arguments is not a number.
9+
*/
110
function RGBToHex(r, g, b) {
211
if (typeof r !== 'number' || typeof g !== 'number' || typeof b !== 'number') {
312
throw new TypeError('argument is not a Number')

0 commit comments

Comments
 (0)