Searching Arrays
Searching Arrays
Some array searches answer "where is it?" while others answer "is it here?". Use the result shape that matches the question.
Your task: Find the index of "loops" in topics and store it in loopsIndex. Also store whether "objects" exists in hasObjects. Log both results.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Searching Arrays
Some array searches answer "where is it?" while others answer "is it here?". Use the result shape that matches the question.
Your task: Find the index of "loops" in topics and store it in loopsIndex. Also store whether "objects" exists in hasObjects. Log both results.