+ 2

How can make a new line for this my JavaScript code? I want them to be on separate lines.

var myArray = []; myArray = ["Safianu Mohammed", "mohammedsafianu"]; function cutName(name){ var fname = name; return fname; } document.write(cutName("[\"Safianu\", \"Mohammed\"]")); var myInfo = {}; myInfo = { fullName: cutName(name), skype: myArray[1], github: "null" }; document.write(myInfo.fullName, myInfo.skype, myInfo.github);

17th Apr 2017, 1:25 PM
Safianu Mohammed
Safianu Mohammed - avatar
4 Antworten
+ 1
stop use document.write(), start use html tags
17th Apr 2017, 1:27 PM
Yaroslav Pieskov
Yaroslav Pieskov - avatar
- 1
@Andrew, its JS, not Java. method document.write() put text in DOM so maybe <br> in the end of the line will help
17th Apr 2017, 1:45 PM
Yaroslav Pieskov
Yaroslav Pieskov - avatar