10.
Which of the following methods can be used to convert a value to a string in JavaScript?
.toString()
String()
parseInt()
parseFloat()
Correct: A, B
In JavaScript, the .toString() method and the String() function can both be used to convert a value to a string. The .toString() method is available on all JavaScript objects and can be applied to convert a number, boolean, or object to a string. The String() function is a global function in JavaScript that can also be used to convert values to strings.