ES6 - valueOf()



This method returns the primitive value of a String object.

Syntax

string.valueOf()  

Return Value

Returns the primitive value of a String object.

Example

var str = new String("Hello world"); 
console.log(str.valueOf( ));    
Advertisements