Javascript String toString()

Introduction

The toString() method returns a string representing the specified String.

str.toString()

The following example displays the string value of a String object:

var x = new String('Hello world');

console.log(x.toString()); // logs 'Hello world'



PreviousNext

Related