Are you copy the second function and game you this error?
looks work to me here and I can’t find any i. Can you give your input. Look mine here Edit fiddle - JSFiddle - Code Playground
And to mention again its just my style not my function as I copied it from hints and just remove the default paremeter.