Skip to content
This repository was archived by the owner on Feb 19, 2022. It is now read-only.
This repository was archived by the owner on Feb 19, 2022. It is now read-only.

Concise methods example #16

@mxstbr

Description

@mxstbr

In the concise methods section the explanation provided is:

"In object literals and classes we can condense render: function () {} to render()"

And the example is the following:

const foo = function () {
  return "foo"
};

const a = "a";

const obj = {foo, a};

console.log(obj.foo());
console.log(obj.a);

This doesn't showcase at all what the description says. I think a better example would be something like:

const obj = {
  foo() {
    return "a";
  }
};

console.log(obj.foo());

With the console output:

"a"

Would be happy to submit a PR if you think that aligns with the goals of this project! Great resource by the way!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions