Do you know what will be the output of this code?
JavaScript
console.log("a-b-c".replace("-", "+"));
Show answer and explanation
The answer is "a+b-c".
With a string pattern, replace stops after the first match. Use replaceAll("-", "+") or replace(/-/g, "+") to replace every one.