Skip to content

Incorrect explanation of object to primitive  #1569

@dheeraj-br

Description

@dheeraj-br

Issue in the section 'Object to primitive conversion' under the 'toString/valueOf' here as well as in the summary section

It is implied that while converting Object to string the toString is called first if its not present then vallueOf is called, this is not correct, because if toString is not present javascript calls the Object.prototype's toString method which outputs "[Object Object]"

Here is Demo on JsBin https://jsbin.com/vikisihosa/edit?js,output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions