Because you're invoking the execution of "filter" on str, which is an object without a function called "filter" of its own nor by prototype. Since filter is not present the property's value is undefined, which cannot be invoked because its type is not function.