Ask coding questions

← Back to all posts
Something's wrong with my function.
cuber1515 (91)

Error with a function

So I'm making a small website for practicing JavaScript, it's just a bunch of window history stuff.

The problem is that whenever I add that last variable (it's in the script.js file) the repl just gives up even trying to run.

Help please

AlexDaCoder (21)
  1. onclicick?
  2. when using void to execute javascript, use an self-executing anonomous function like href="void((() => {/*code here*/})())"
void( // start void
  ( // start parens
    () => { // start arrow function
      // function body
    } // end arrow function
  )() // execute whatever is in the parens, which is a func
) // end void