Home » JavaScript » JavaScript Variables » Question
  1. Assume that we have to convert “false” that is a non-string to string. The command that we use is (without invoking the “new” operator)
    1. String newvariable=”false”
    2. Both false.toString() and String(false)
    3. String(false)
    4. false.toString()
    5. None of these
Correct Option: B

The three approaches for converting to string are: value.toString(),”” + value and String(value). A non-string can be converted in two ways without using a new operator false.toString () and String(false).



Your comments will be displayed only after manual approval.