{
async function sendMsg(evt) {
if (evt.keyCode === 13) {
console.log(msgs);
mutable msgs = msgs.concat([evt.target.value]);
}
}
return htl.html`
${msgs.map((msg) => htl.html`<p>${msg}</p>`)}
<input class="text" onkeydown=${sendMsg}></input>
<button onclick=${() => (mutable msgs = [])}>clear</button>
`;
}