Aryan PrajapatKnowledge Contributor
Can we break JavaScript Code into several lines? If yes, then How?
Can we break JavaScript Code into several lines? If yes, then How?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
Yes, We can break JavaScript code into several lines; we can break within a string statement using a backslash (”) at the end of the first line code.
For example,
document.write (“This is a program”);
And when you are not within a strong statement and want to change to a new line, then JavaScript ignores the break in the line.
For Example:
var x=1, y=2,
z=x+y;
The above code is perfect for better understanding, but it might hamper our debugging, so it is not advisable to write.