This example shows how variables are added depending on the type. Click on the page and watch the script run. The following is the <script> that is on the page. The typeof function returns the variable type.

var sA = "1";
var sB = "2";
alert(typeof(sA))
alert(sA + sB);

var iA = 1;
var iB = 2;
alert(typeof(iA))
alert(iA + iB);

var bA
bA = true
alert(typeof(bA))
alert(bA)

var fA, fB, fTotal;
fA = 3E2;
fB = 0.345;
alert(typeof(fA))
fTotal = fA + fB;
alert(fTotal);

alert(sA + iA);
alert(sA + fA);
alert(sA + bA);
alert(iA + bA);
alert(iA + fB);
alert(bA + fB);