'tokens' is an array, not a number so you can't compare it as one, arrays do have a public field called length to indicate how many values are in it, so if(tokens.length > 4) would work.