Skip to content

Syntax doubt #41

@asd123ea

Description

@asd123ea

I'm reading the 10 chapter, Building Microservice systems.
And I came accross to this syntax below at page 506 (Standardizing service boilerplate)

function createClient (ns, opts) {
  return createClient[ns] || (createClient[ns] = nos(net.connect(opts)))
}

Didn't quite understand the createClient[ns] = nos(net.connect(opts)) part, What it means? Why should I use it?

Is this syntax documented anywhere?

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