I have the following code, it takes user input string value, assigns alphabetic characters with specific numbers and later on sums them up. Problem is that my code won't work, I wonder where did I make mistake.
<script type="text/javascript">
function addalldata() {
a = j = s = 1;
b = k = t = 2;
c = l = u = 3;
d = m = v = 4;
e = n = w = 5;
f = o = x = 6;
g = p = y = 7;
h = q = z = 8;
i = r = 9;
let userinputname = document.getElementById("fullusernameinput").value;
let userinputnamelow = userinputname.toLowerCase();
let userinputnamearray = userinputnamelow.split('');
let pirvelijami1 = userinputnamearray.reduce((a, b) => +a + +b, 0);
alert(pirvelijami1);
}
</script>
It returns NaN