Question PRG-JS-0073
HardWhat is the output of this program?
const s = "abcabc";
console.log(s.replace("a", "X"), s.replaceAll("a", "X"), s.split("b"), [..."héllo"].length, "abc".at(-1));
- A.
Xbcabc XbcXbc [ 'a', 'cab', 'c' ] 5 c
- B.
Xbcabc XbcXbc [ 'a', 'ca', 'c' ] 5 c
- C.
Xbcabc XbcXbc [ 'a', 'ca', 'c' ] 6 c
- D.
XbcXbc XbcXbc [ 'a', 'ca', 'c' ] 5 c
Sign up free to see the answer and a step-by-step explanation.