Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Array #includes #string
ADD COMMENT
Topic
Name
8+8 =