I need to add two integers together in JavaScript - no matter what I do, I just can't seem to get anything to work. I started with
var varC = $('#varA').val() + $('#varB').val();
This just concatenated them. I then found out that adding .val() returns a string so that would explain it.I tried removing the '.val()' but it didn't return anything. I've tried replacing the 'var' with 'let' but, again, no joy.
I've tried looking for some sort of function that would return what I want but I can't find anything. Can anyone please tell me how I can do this?