Configuration

1
Console Output
>
Original String:
I Love JavaScript
Method Used:
toString()
Result:

Method Description

toString(): returns a string representation of an object.

valueOf(): returns the primitive value of an object.

Both methods are inherited from Object.prototype.

JavaScript uses them during type coercion and string/number conversions.