i have checked it twice in my code its giving undefin
ed in unordered list if i m adding the task , kindly resolve.
i m sending the code through this only
const express=require(‘express’)
const app=express()
app.use(express.urlencoded({extended:true}))
let tasks=[
‘sample task’
]
app.get(’/’,(req,res)=>{
let tasklist=tasks.map(t => <li>${t}</li>).join(’\n’)
res.send( <html> <body> <form action="/" method="POST"> <input name=-"newtask"> <button type="submit">ADD</button> </form> <ul> ${tasklist} </ul> </body> </html> )
})
app.post(’/’,(req,res)=>{
tasks.push(req.body.newtask)
res.redirect(’/’)
})
app.listen(3333,()=>{
console.log(‘server started at https://localhost:3333’)
})