Multiple choice general knowledge

With the advent of JavaScript1.2, the String.replace() method facilitates character replacement in strings. How would you remove every 'x' from the variable myString without the new features of 1.2?

  1. for(var i = 0; i < myString.length; i++) {

  2. var myArray = myString.split('x'); myString = myArray.join('');

  3. It wasn't possible until now. Thanks JavaScript1.2!

  4. The first two both work fine

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Before JavaScript 1.2's enhanced String.replace(), you could remove characters using two approaches: 1) iterate through the string building a new string without 'x', or 2) split on 'x' and join the array with empty string. Both methods work, though split/join is more concise.