请问indexOf要怎么使用?按百度好像不行

小程序 文章 2022-01-10 12:00 291 0 全屏看文

AI助手支持GPT4.0

请问indexOf要怎么使用?按百度好像不行May I ask how to use indexOf?

请问indexOf要怎么使用?按百度好像不行

求一个indexOf的使用方法,百度找了几个方法好像不行,我现在需求是我网络请求了一个数据然后获取到数据遍历数组了,然后判断数组元素中含某一个字符串就返回自定义文字

For a method of using indexof, Baidu has found several methods that don't seem to work. What I need now is that I request a data from the network, get the data, traverse the array, and then judge that the array element contains a string, and then return the custom text

回答:

困难:

用不了是啥意思???报错?返回为空?


老张:

string,不是array

Mr.Zhao:

你是怎么用的,按百度?怎么个百度?

-EOF-

AI助手支持GPT4.0