JSLint keeps giving me the following error whenever defining 2 functions:
Problem at line __ character _: Unexpected ‘var’.
I have tried declaring all vars at the beginning of the script but this does not solve the issue. Tried digging through the web for an answer but cannot seem to find one.
var walk = function walker(node, func) {
//code
}
var disp= function display(){
//code
return d;
}
Try declaring them like this:
The problem with:
is JSLint expects
walkto be either assigned a function or the result of the function. If you want to assign a function to the variable, the variable name becomes an alias of the function. To make JSLint happy, it should be an anonymous function.