BugHunt

JavaScript string exercises

JavaScript strings rarely throw errors. They just produce the wrong text: "5" + 1 is "51", replace() stops after one match, and ${name} in single quotes prints as-is. Each exercise here is a short function with one of those bugs.

Run the tests, read what came back, fix the line. Everything runs in a sandboxed worker in your browser.

See the 12 exercisesOr follow the 30-day path

The strings bugs you will meet

The exercises

Errors you might be searching for

More JavaScript practice by topic

Questions

Do I need Node.js?

No. Your code runs in a sandboxed Web Worker in the browser.

Which JavaScript version?

Plain modern JavaScript, with no frameworks. The same bugs turn up in React and Node code.