Strings

Pick the Right Search

Pick the Right Search

Two search functions can both return true for the same text while answering different questions. One asks whether text appears anywhere; the other asks whether it appears at the beginning.

Your task: Set prefixChecker to the name of the function that correctly checks whether text starts with a token.

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.

Pick the Right Search

Two search functions can both return true for the same text while answering different questions. One asks whether text appears anywhere; the other asks whether it appears at the beginning.

Your task: Set prefixChecker to the name of the function that correctly checks whether text starts with a token.

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.

Console

Run code to see output.