NightDev Community Forums

Help - eval giving me Undefined error

Gosh, $(touser) $(eval const responses = [’ is a dumb, stupid, idiot!’, ’ is the WORST!’, ’ stinks, stinks REAL bad!’])

Hey @ryanhasfriends!

I mean, you don’t even pick a response from your list… The error you get is because you use wrong quotation marks tho’: instead of ', " or better yet `.
Here’s a fix:

$(eval r=[`is a dumb, stupid, idiot`,`is the WORST`,`stinks, stinks REAL bad`]; `Gosh, $(touser) ${r[Math.floor(Math.random()*r.length)]}!`)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.