Skip to content

Recoded-sana-a-resouces/array_lab_2_js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Arrays searching lab

Check if an array includes a string.

Overview

Make a function called findStringInArray(array, itemToFind) that looks at all entries in an array and compares it to a string one by one. If the string is found then it prints a message that says the string has been found.

Example

let array = ["Pheobe", "Chandler", "Ross", "Monica", "Rachel", "Joey"];
findStringInArray(array, "Chandler")
// Output in console => Found Chandler, its postion is 1

Requirements

Go over the given array and do the following:

  1. Go over all the items in the array and compare them to the passed string
  2. If the passed has been found then print "Found {item that was searched}, its position is {its index}
  3. If it didn't find it, it says item has not been found.
  4. This should work with any strings array!

Good luck :D

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages