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 |
How to create scale in P info
What are the different functional component in javascript?
What are nodes in javascript?
What are undeclared and undefined variables?
What is unescape() function?
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
What is class example?
What is ‘this’ keyword in JavaScript?
Is javascript enabled on chrome?
What is screen object in JavaScript?
Where can I learn javascript for beginners?
Difference between scripting language and programming language??