ES6 - String Method valueOf()


Advertisements


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( ));    

Output

Hello world

es6_strings.htm

Advertisements