Thursday , September 19 2024

Review the following code: let msg1 = ‘hello’; let msg2 = msg1.slice(-1); console.log(msg2 ? msg2 : msg2 + msg1); What will appear on the console as a result?

Questions BankCategory: JavaScript Essentials 1Review the following code: let msg1 = ‘hello’; let msg2 = msg1.slice(-1); console.log(msg2 ? msg2 : msg2 + msg1); What will appear on the console as a result?
Review the following code:

let msg1 = 'hello';
let msg2 = msg1.slice(-1);
console.log(msg2 ? msg2 : msg2 + msg1);

What will appear on the console as a result?

  • hello
  • ohello
  • o
  • h

More Questions: JavaScript Essentials 1 – JSE1: Final Test