in JavaScript by
Suppose we have a text "human" that we want to convert into string without using the "new" operator. Which is the correct way from the following to do so:

a) toString()

b) String(human)

c) String newvariable="human"

d) Both human.toString() and String(human)

1 Answer

0 votes

Answer: D

Reason: There are three common ways to convert the text into strings:value.toString(),"" + value and String(value). We can convert a text to string without using "new" operator that are: human.tostring() and the another one is String(human).

Related questions

0 votes
asked Jun 9 in JavaScript by sharadyadav1986
0 votes
asked Mar 22, 2021 in JavaScript by Robindeniel
0 votes
asked Mar 21, 2021 in JavaScript by rajeshsharma