you're calling foo.equal() and foo is undefined.