PDANGER
PDANGER

Reputation: 87

Adding 2 Values together in JS

So this probably pretty simple to do, but I'm now just learning this. I'm trying to add two values together to fill an input

Obviously that doesn't work, can someone please lend a hand?

Upvotes: 1

Views: 76

Answers (1)

Dalorzo
Dalorzo

Reputation: 20024

There is a ; between the 2 values you are adding remove it like:

var summedValues = userInfo.fname + userInfo.lname;

In javascript ; means the end of the line and therefore it is not taking the consideration the + that is after it.

Upvotes: 3

Related Questions