简体   繁体   English

按过滤方法搜索输入

[英]search input by filter method

I made a search input by using filter method but there is a warning with this.我使用过滤器方法进行了搜索输入,但有一个警告。 What was wrong?什么问题?

Code picture代码图片

1

You have cases in which you don't return anything.在某些情况下,您不返回任何东西。

if (conditionA){
    return ...;
} else if (confitionB) {
    return ...;
}
// Nothing gets returned

You should add a return at the end of your function for when coditionA and coditionB are both falsecoditionAcoditionB都为false时,您应该在 function 的末尾添加一个 return

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM