+ 1

Make space between two JS function inputs

I am having issues trying to find the answer to this question on a search engine/ translating this to English. (super new at all this) but if anyone could explain how to do this its greatly appreciated. Am I possibly missing some possible HTML elements? (currently brushing up at this moment) After that I plan on stopping by the www.w3schools.com/ because I didn't realize I would fall in love with coding.... this questions just happens to bother me more so because I don't know how to ask it function person (name, age) { this.name = name; this.age = age; } var TeaSama = new person("TeaSama", 25); var Britta = new person("Britta", 21); document.write(TeaSama.age); //how would I put a space between the ages? I feel like this is super simple. document.write(Britta.age);

18th Jul 2017, 7:48 AM
Tea Szukala
Tea Szukala - avatar
3 Answers
+ 3
just put a document.write with space ... document.write(" ");
18th Jul 2017, 7:58 AM
Manish Kumar
Manish Kumar - avatar
+ 3
You could also just use one document.write call and use concatenation. document.write(TeaSama.age + " " + Britta.age);
18th Jul 2017, 8:08 AM
ChaoticDawg
ChaoticDawg - avatar
0
omg...... *facepalm* Thank you!!!
18th Jul 2017, 7:59 AM
Tea Szukala
Tea Szukala - avatar