-3

For example:

Output.setText("Number of Cars = "+cQuantity
        + "Number of Trucks = " +tQuantity

How would I have the trucks to go on a separate line in the output on the Gui? Sorry, I am new to coding.

1 Answers1

2

You may use the \n escape character, or in ES6 you may use template strings:

console.log('Hello \n World');

console.log(`Hello
World`);

Both of these will yield the same result:

Hello
World

If you are planning to output the text to html, you could include a <br/> tag:

document.getElementById('element').innerHTML ='Hello<br/>World';