Javascript String valueOf()

Introduction

The valueOf() method returns the primitive value of a String object.

str.valueOf()

Using valueOf()

let x = new String('Hello world');
console.log(x.valueOf()); // Displays 'Hello world'



PreviousNext

Related