---
title: "Is JavaScript Code can be broke down into several lines?"  
description: "Is JavaScript Code can be broke down into several lines?"  
author: "Nishi Tiwari"  
published: 2020-02-05  
updated: 2020-09-13  
canonical: https://www.mindstick.com/interview/33692/is-javascript-code-can-be-broke-down-into-several-lines  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# Is JavaScript Code can be broke down into several lines?

Within a string statement breaking can be done by the use of a backslash, '\', at the end of the first line

For example:

document.write("This is \a program");

If we change to a new line when not within a string statement, then javaScript ignores break in the line.

## For example:

var x=1, y=2,

z=

x+y;

The above code is perfectly good, but it is not advisable as it hampers debugging.

## Answers

### Answer by Nishi Tiwari

Within a string statement breaking can be done by the use of a backslash, '\', at the end of the first line

For example:

document.write("This is \a program");

If we change to a new line when not within a string statement, then javaScript ignores break in the line.

## For example:

var x=1, y=2,

z=

x+y;

The above code is perfectly good, but it is not advisable as it hampers debugging.


---

Original Source: https://www.mindstick.com/interview/33692/is-javascript-code-can-be-broke-down-into-several-lines

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
