Concatenating numbers as string in Javascript
问题 myCoolObject { a: 0 b: 12 c: 24 } I want to concatenate a , b and c so that they look like a unique string "a-b-c" (or "0-12-24" in the example). a , b and c will always represent numbers. Converting each one of them from int to string require a lot of code: I'd just use sprintf() if I were in PHP or C, but how can I do this in JS without using toString() for each parameter and writing too much code? Whole code: var pickedDate = this.getSelectedDay().year.toString() + "-" + this