A
A
Alexander2020-05-19 16:47:13
JavaScript
Alexander, 2020-05-19 16:47:13

How to display an object in res.end?

Please tell me how to display the message object. I've tried different ways and it doesn't work...

res.end('<h1> Ваше сообщение: ${message} </h1>')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hzzzzl, 2020-05-19
@pasperfectionist

string?

`<h1> Ваше сообщение: ${JSON.stringify(message)} </h1>`

can it be so beautiful
`<h1> Ваше сообщение: ${JSON.stringify(message, null, 2)} </h1>`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question