program showing string concatenation?

Answers were Sorted based on User's Feedback



program showing string concatenation?..

Answer / rajeshwar

Hi,

I think the above answer will not work for java script as
per my knowledged.

$variable_name are used in php but not in javascript. To
acheive the requirement in java just remove $ symbols.

var a="hello";
var b="world";

var concat= a+b; alert(concat);

Is This Answer Correct ?    10 Yes 1 No

program showing string concatenation?..

Answer / prasadkonnur

HI Rajeshwar,

you are right. $variable work in php. not in javascript.

var a="hello";
var b="world";

var concat= a+b;
document.writeln(concat);

Is This Answer Correct ?    5 Yes 0 No

program showing string concatenation?..

Answer / vinoth180

var a="hello"
var b="JavaScript"
document.write(a+b);


Try this one...their is no need for the third for calculation

Is This Answer Correct ?    2 Yes 1 No

program showing string concatenation?..

Answer / prasadkonnur

var a="hello";
var b="world";

var concat= $a+$b;

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More JavaScript Interview Questions

How is it possible to get the total number of arguments that are passed to a function?

0 Answers  


Why do we need npm?

0 Answers  


Define a named function in javascript.

0 Answers  


What is array explain it?

0 Answers  


What are the four basic data structures in javascript?

0 Answers  






What is the difference between typeof and instanceof operators in Javascript?

0 Answers  


What is the scope of variables in JavaScript?

0 Answers  


How can a page be forced to load another page in javascript?

0 Answers  


What is the main difference between Client side JavaScript and and Server side Java Script?

7 Answers   Ramco,


What is break and continue statements?

0 Answers  


What are the uses of javascript in web page designing?

0 Answers  


If an array with name as "names" contain three elements, then how will you print the third element of this array?

0 Answers  


Categories