Free String Explorer: try Python and JavaScript string operations

Free JavaScript exercises with solutions

Practice writing JavaScript a small step at a time. Start with values and calculations, then work with arrays, strings, and unreliable starter code. This page connects you to free lessons and exercises from the existing JavaScript tracks.

No account needed for free previews · Hints, tests, and explained answers

Before you start: JavaScript Foundations assumes no programming experience. Debugging and string interview practice suit learners who already understand functions, conditions, loops, arrays, and objects. Choose the starting point that fits your current skills; the order is a suggestion, not a requirement.

Worked example: select scores at an inclusive boundary

A score of 5 should qualify when the minimum is 5. Select qualifying scores in their original order, keeping duplicates. An inclusive comparison uses >=, not >.

const scores = [0, 5, 10, 5];
const qualifying = [];
for (const score of scores) {
  if (score >= 5) {
    qualifying.push(score);
  }
}
console.log(qualifying);
// [5, 10, 5]

The loop visits each value once and builds a new array. Zero is a valid number even though it does not qualify for this threshold. Repeated scores remain repeated results. Check an empty array, a score exactly at the threshold, and a score just below it. In a function exercise, return the array instead of relying on console.log.

How to practice with the examples and tests

Read the required function signature and expected return type. JavaScript distinguishes numbers, strings, null, and undefined, so avoid converting types unless the contract asks you to. Predict boundary results, run the tests, and use the first failing case to narrow the problem. Reveal hints gradually, then compare both the code and reasoning with the solution.

Choose your next free lesson or exercise

Start with JavaScript basics

Practice returning values, greeting text, arithmetic, and small calculations. The first two lessons introduce execution and variables without assuming previous programming experience.

Read a free lesson

Try free exercises with hints and solutions

See the full JavaScript Foundations course outline →

Repair common JavaScript mistakes

Start with empty-input, missing-field, and division cases. Reduce a failure to a small example and check that your repair handles valid zero values and repeated calls.

Read a free lesson

Try free exercises with hints and solutions

See the full Debugging and Testing Code — JavaScript course outline →

Practice JavaScript strings

Explore slicing, searching, whitespace, and Unicode-related string behavior. Read character restrictions carefully: JavaScript string length and indexing use UTF-16 code units, which are not always whole visible characters.

Read a free lesson

Try free exercises with hints and solutions

See the full JavaScript String Interviews course outline →

Questions about free JavaScript practice

Do these exercises need Node or external packages?

No. The linked free browser exercises run JavaScript in an isolated worker on your device. They do not require Node, external packages, network requests, or an account. React course projects are separate local-development tasks.

Are the solutions available for free exercises?

Yes. The free exercise page provides progressive hints, tests, a reference solution, and an explanation. Saving code and progress requires an account; opening a free exercise does not.

Should I learn TypeScript next?

Learn JavaScript functions, arrays, objects, scope, and missing-value handling first. Once those are comfortable, the TypeScript course adds strict types and safer data handling. JavaScript debugging is another useful next step if you want more practice reading and repairing code.

Keep your progress when you are ready

Free previews are available without an account. An account lets you save your exercise code and progress. Create an account to save progress. Paid lessons and practice are clearly separated from these free links. Compare Course access, Practice Pack, and Complete Bundle.

Free lessons and coding exercises

Find a starting point, read a worked example, and try matching exercises with hints and solutions. No account is needed for free previews.

Read practical Python, JavaScript, and SQL tutorials →