<center><h1>Check the JS Panel</h1></center>
let myString = "That's my string";
let yourString = new String("That's your string");
console.log(typeof myString); // outputs "string"
console.log(typeof yourString); // outputs "object"
//MDN says primitives and objects can SOMETIMES be interchangeably used
let yourBigString = yourString.toUpperCase();
console.log(yourBigString); // outputs "THAT'S YOUR STRING"
let myBigString = myString.toUpperCase();
console.log(myBigString); // outputs "THAT'S MY STRING"
//since yourString is an object
yourString.yourScore = 100;
console.log(yourString.yourScore); //outputs 100 as expected
//If primitives and objects can ALWAYS be interchangeably used, this should work on primitives as well
myString.myScore = 100;
console.log(myString.myScore); // Dang! this outputs 'undefined'
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.