Algorithm Question?

When adding two strings together are they automatically concatenated?

Example

console.log(‘bob’+‘joe’);

would the output be?

bobjoe or bob, joe

answer is left to right
bobjoe

1 Like

If only there were a way we could test that. I guess we’ll never know

4 Likes

Thank you kindly:) I appreciate your humble answer

haha thanks actually led me to using console i completely forgot just starting out btw i appreciate your humor! thanks for the help :slight_smile:

2 Likes

it will be bobjoe and if u want to have space in between then write 'bob ’ +‘joe’;

1 Like

Using a comma instead of a “+” will also insert a space.

1 Like

Not unless you have the statement like this: console.log(‘bob’+','+‘joe’);

1 Like