The valueOf() method returns the primitive value of a String object.
valueOf()
str.valueOf()
Using valueOf()
let x = new String('Hello world'); console.log(x.valueOf()); // Displays 'Hello world'