News for hackers. Stuff that matters.
Re:Ways to Invoke a Function in JavaScript by underwater on Sunday June 18, 2017 @07:17PM (#14583543)
Yeah, considering that `Function.prototype.apply === console.log.apply` there are a lot of dupes here. I would consider eval/new Function to be a legitimate fourth way though.
Re:Ways to Invoke a Function in JavaScript by inimino on Sunday June 18, 2017 @09:34PM (#14584055)
Eval is another way to run arbitrary JS code. It's cheating here because nothing about the use of eval is specific to calling a function.

According to that standard, opening an external interpreter would be yet another way.

Agree with the above that there are really only three ways here.

Re:Ways to Invoke a Function in JavaScript by jmull on Sunday June 18, 2017 @08:53PM (#14583883)
Yes, you have a good point about eval and anything else that boils down to invoking a string as a function.