Answers for "string includes array string javascript"

0

if Array includes string

function droids(arr) {
    result = "These are not the droids you're looking for." 
    
    for (str of arr) {
        if (str == 'Droids')
            result = "Found Droids!"
    }
    
    return result;
}
Posted by: Guest on September-19-2021
0

js array string includes

if (new RegExp(substrings.join("|")).test(string)) {
    // At least one match
}
Posted by: Guest on July-15-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language