Write a JavaScript function which can take any number of
strings as arguments and outputs them as a single
concatenated string.
Answers were Sorted based on User's Feedback
Answer / ashok
<script type="text/javascript">
var a="i am ashok choudhary!";
var b="i belongs to jaipir.";
document.write(a+b);
</script>
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / szilveszter safar
function concatStrings () {
return Array.prototype.join.call(arguments, '');
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / madhav arora
Lets Declare two variables :"a" and "b" to solve this
problem :
var a = 'Hello world!';
var b = 'I am a JavaScript hacker.'
First of all, you can concatenate strings, sew them
together as it were:
document.write(a + b);
gives
Hello world!I am a JavaScript hacker
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / upendar
<script type="text/javascript">
var concatString= "";
function concatArgs() {
var argsLength = arguments.length;
for(var i=0; i<argsLength; i++) {
concatString = concatString + arguments[i];
}
}
document.write(concatString);
</script>
| Is This Answer Correct ? | 0 Yes | 1 No |
Which built-in method returns the characters in a string beginning at the specified location?
What is difference between ajax and javascript?
What is an Event Bubbling in Javascript?
Can I open javascript on iphone?
What is the difference between synchronous and asynchronous JavaScrip
How do I get javascript?
Explain with an example the use of event handlers in javascript.
What is differential inheritance?
what is the extension of java script.
Why javascript is dangerous?
What is the difference between "var" and "let" keywords?
Is javascript or python easier?