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



Write a JavaScript function which can take any number of strings as arguments and outputs them as a..

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

Write a JavaScript function which can take any number of strings as arguments and outputs them as a..

Answer / szilveszter safar

function concatStrings () {
return Array.prototype.join.call(arguments, '');
}

Is This Answer Correct ?    0 Yes 0 No

Write a JavaScript function which can take any number of strings as arguments and outputs them as a..

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

Write a JavaScript function which can take any number of strings as arguments and outputs them as a..

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

Post New Answer

More JavaScript Interview Questions

How to create scale in P info

0 Answers   MAHINDRA,


What are the different functional component in javascript?

0 Answers  


What are nodes in javascript?

0 Answers  


What are undeclared and undefined variables?

0 Answers  


What is unescape() function?

0 Answers  






Hi all, I got a job in Bangalore even though it's recession time. They have said my project will involve Java, Ruby on Rails, Ajax and they also said Web Services (which i have always wanted to try) and some stuff I have not much exposure like REST, mashups and Struts. Can anyone tell me if there are some good training or conferences to get to speed with these technologies. I need to do really good in my job. Thanks, Vaibhavi

1 Answers  


What is class example?

0 Answers  


What is ‘this’ keyword in JavaScript?

0 Answers  


Is javascript enabled on chrome?

0 Answers  


What is screen object in JavaScript?

0 Answers  


Where can I learn javascript for beginners?

0 Answers  


Difference between scripting language and programming language??

1 Answers  


Categories