How would I take 1 string and then add on to it
for example,
“string” + “string2” = “stringstring2”
You can try something like this
let string1 = “string”;
let string2 = “string2”;
let result = string1 + string2;
Did it work?
oml thank you so much this just saved me hours
You can also do let result = "string1" + "string2";
Yeah… According to JavaScript documentation, the plus (+
) can be used for lots of things, like getting the sum of two number
types, concatenating two string
types, or converting it into a number
type?
1 + 1 === 2 // Sum of 1 plus 1 is 2.
"JavaScript is " + "very very weird!" === "Javascript is very very weird!" // Adds up the two string types
+new Date() === 12345678 // UNIX time (adds one every time a milisecond passes.)