##JavaScript (ES6), 65 bytes
JavaScript (ES6), 65 bytes
Latecomer to the game...
01?alert`Hello, World!` : a_l_e_r_t ` H e l l o , W o r l d ! `
Becomes:
0?lr`el,Wrd`:alert`Hello, World!`
Obviously, neither the a_l_e_r_t
function nor the lr
function does exist. That's OK, because their respective code paths are never executed.
###Demo
Demo
let code0 = "01?alert`Hello, World!` : a_l_e_r_t ` H e l l o , W o r l d ! `";
let code1 = code0.replace(/../g, s => s[0]);
console.log(code0);
eval(code0);
console.log(code1);
eval(code1);