Skip to content

Wiki's code sample for typedef annotation is wrong #3577

Closed
@DerekNonGeneric

Description

@DerekNonGeneric

The code sample for the @typedef tag provided by the wiki is wrong.

It is currently displaying the following.

/** 
 * @typedef {{
 *            foo:string,
 *            bar:number,
 *            foobar:number|string
 *          }}
 */
var Mytype;

This results in error because there are no parenthesis around the | operands.

I would PR the wiki if it were possible, so instead I've demonstrated my proposed fix elsewhere.

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