I'm just in the console in Chrome for now. I created this variable:
url = window.location.href
which gives:
url "http://www.example.com/trips/dest/australia-and-south-pacific/cntry/fiji/"
Now I tried this:
if (url.indexOf('australia-and-south-pacific') > 0) {return 'foo';}
Which returned:
SyntaxError: Illegal return statement
I expected the console to return 'foo'.
Why is this happening? I noticed that after receiving this error, give it afew seconds and a new error appears:
Uncaught TypeError: Cannot read property 'hide' of undefined
If that helps to diagnose?
console.log('foo')
return
statement anywhere but a function.