0 votes
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
by

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 Oct 9, 2022 in JavaScript by Robin
0 votes
asked Jan 23, 2020 in JAVA by rahuljain1
...