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 to go next field without filling the text? Which function should we use?

4 Answers  


What is a function callback?

0 Answers  


What is the difference between test () and exec () methods?

0 Answers  


how to hide alphabets in java as password '*'

0 Answers  


What’s a way to append a value to an array?

0 Answers  


How can a value be appended to an array?

0 Answers  


Define a named function in javascript.

0 Answers  


What are exports and imports?

0 Answers  


What is unobtrusive javascript?

0 Answers  


What is a named function in JavaScript? How to define a named function?

0 Answers  


What e means?

0 Answers  


How long does it take to learn javascript?

0 Answers  


Categories