How to use valueOf() to get the primitive value of a String object in JavaScript

1 Answer

0 votes
// str.valueOf()

var str = new String('JavaScript');

var s = str.valueOf(); 

document.write(s);

/*
run:

JavaScript 

*/

 



answered Aug 12, 2016 by avibootz
...