I am trying to concatenate variables in inside a function and then return. In php we just put a period before the \"=\" but it is not working in javascript.
Can someone
The +
operator will concatenate two strings, ie. "Hello" + " World" //> "Hello World". Using +=
is a short cut for assigning and concatenating a variable with its self.
ie. instead of:
var myVar = "somestring";
myVar = myVar + "another String";
you can just do:
var myVar = "somestring";
myVar += "another String";
For your problem:
function NewMenuItem() {
//This is just a small example. The end result is more broader then this
var output = " ";
output += " ";
return output;
} //end of NewMenuItem(){