-3

In this code eval function is used: code1

function in string has 3 params, but eval runs function with 2 params:

code2

Why ?

Wallers Jason
  • 75
  • 1
  • 11
  • 2
    Please don't use images of code, instead copy/paste the text of the code into the body of your question. – esqew Aug 22 '18 at 19:47
  • 3
    You've defined openURL twice. The second one ends up being the only one that's accessible – Nicholas Tower Aug 22 '18 at 19:49
  • 5
    There is no **function overloading** in javascript. The second function overwrites the first, so you end up with only one `openURL` function that takes two parameters. – ibrahim mahrir Aug 22 '18 at 19:50

1 Answers1

6

You cannot have 2 functions with the same name in the same scope.

There is no function overloading in javascript. (thanks ibrahim mahrir).

Delete the openURL function that starts on line 5317.

2019 Edit: It is possible to call different methods based on the number of arguments: pattern: https://johnresig.com/apps/learn/#90

lmarqs
  • 1,469
  • 13
  • 16