Puzzle 6 of 15 · Mutation & return values
Trace an array push followed by join. Predict the method’s return value and the contents read by the next console log. Choose an output below, then check the explanation. No signup needed. Browse puzzles by topic →
1const items = ["a", "b"]; 2console.log(items.push("c")); 3console.log(items.join("-"));
Predict the console output. Each line is a separate log.
c a-b-c
2 a-b
3 a-b-c
3 a-b