JavaScript · Middle · Question 75 of 75

What does arr.with(1, "x") return for arr = ["a", "b", "c"]?

Explanation

with is the immutable counterpart of arr[1] = "x". It supports negative indices like at and throws RangeError for out-of-range ones.

Further reading

Problem with a question

JavaScript · Middle · question 75

Test yourself

Take the JavaScript · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz