Can Javascript code be broken in different lines?

 Posted by Chikul on 12/22/2009 | Category: JavaScript Interview questions | Views: 6418
Answer:

Yes,
Breaking is possible within a string statement by using a backslash "\" at the end .
Ex:
document.write("Good Morning. \
I am Mr. John");

But it is not possible within any other javascript statement.
Ex :
is possible but not
document.write \
("Good Morning. I am Mr. John");


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response