0

I saw a piece of javascript code similar to the one below. I understand the eval() function but don't understand the purpose of the first pair of parenthesis around the function name and another parameter. Thank you for the help.

(1,eval)("function Func() {}")
R.J. Dunnill
  • 2,049
  • 3
  • 10
  • 21
George Lei
  • 467
  • 5
  • 5
  • Where have you seen the code. `(1,eval)` is an expression which will return `eval` because comma operator returns last expression of all the expression which are separated. – Maheer Ali May 15 '19 at 04:43
  • 1
    @MaheerAli I think the purpose is to remove the implicit `window` calling context – CertainPerformance May 15 '19 at 04:45

0 Answers0