I am writing a betting calculator for the dutching strategy and cannot figure out how to get the sum of couples multiplied to each other:
var a = document.getElementById("a").value;
var b = document.getElementById("b").value;
var c = document.getElementById("c").value;
I would like to know in which way I can get the following a short way:
var total = (a * b) + (a * c) + (b * c)
If I just had a, b and c, this still would be manageable but I will have more than 10 values and I am sure there is a better way to do this with a short code regardless of the number of inputs I have. Otherwise, this will be unmanageable.
Thank you.