Why do I get an error when I encapsulate the search method? The code is the same as the teacher's, but when I run it, it reports:
Cannot read property 'toLowerCase' of undefined
Does anyone know the reason? ? Thanks