I know I can simply use an if else statement to have the math done for me, and could even create a function that could be called either way depending on the need, but I am trying to based on math simply store either + or - as a variable so it can execute
for example
plusOrMinus = +
5 + plusOrMinus + 5 = 10
eval()but its quite dangerous.eval()and hear the reasoning for why it's "dangerous"eval('document.all(' + elementName + ')'). There is nothing inherently "evil" or dangerous, it's just considered poor practice as the alternatives are faster, less to write and have fewer side effects (from memory, eval can have scope issues but I 'm a little rusty on that because I almost never use it).