I'm currently working on splitting a hexadecimal string into an array of paired numbers. Here is the code snippet I have so far:
function getRGB(hexVal) {
var substrHexVal = hexVal.substring(1,hexVal.length);
var splitHexVal = substrHexVal.split("");
return splitHexVal;
}
var result = getRGB("#00FF00");
result;
The current output looks like this:
["0", "0", "F", "F", "0", "0"]
However, I am aiming to achieve this output:
["00", "FF", "00"]
Although my intention might be clear, I would appreciate some guidance on how to proceed.