Javascript String Question 4

Introduction

What is the output of the following code?


let myStr = "Alexei ";
myStr += "Robert ";
myStr += "White";

myStr = "Alexei ";
myStr = myStr.concat("Robert ");
myStr = myStr.concat("White");

console.log(myStr); // "Alexei Robert White"


console.log(myStr); //  w  w w . j  ava 2  s .com


Alexei Robert White
Alexei Robert White

Note

Make a concatenated string using the concatenate assignment operator




PreviousNext

Related