JS - evaluated function is correct but code does not work

I tried following the example by @flo from weweb team describe here: How can I bind search input value to the map?

But unfortunately I am getting the same error.

I created a function. [Side note: I am getting a ReferenceError issue] as shown below:

Unfortunately same result.