Altering the eval command

I’m trying to alter the command so that it gives a response to suggest an answer.
However when I try to do it, I get the issue: Right-hand side of ‘instanceof’ is not an object

I know I’m doing something wrong, but not sure where it goes wrong.
Command I’m trying is:

$(eval Math.floor((Math.random() * ‘Tilted Towers’), ‘Prison’, ‘Salty Springs’, ‘Lucky Landing’, ‘Dusty Depot’, ‘Pleasant Park’, ‘Anarchy Acres’, ‘Shifty Shafts’, ‘Fatal Fields’, ‘Retail Row’, ‘Tomato Town’, ‘Junk Junction’, ‘Flush Factory’, ‘Moisty Mire’, ‘Greasy Grove’, ‘Snobby Shores’, ‘Loney Lodge’, ‘Haunted Hills’, ‘Wailing Woods’))

That code isn’t valid JavaScript. Here is a fixed version:

$(eval l="Tilted Towers,Prison,Salty Springs,Lucky Landing,Dusty Depot,Pleasant Park,Anarchy Acres,Shifty Shafts,Fatal Fields,Retail Row,Tomato Town,Junk Junction,Flush Factory,Moisty Mire,Greasy Grove,Snobby Shores,Loney Lodge,Haunted Hills,Wailing Woods".split(",");l[Math.floor(Math.random()*l.length)])
1 Like

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