Skip to content

Nit: Our use of function.name might be unnecessary #34

@tylersticka

Description

@tylersticka

@mrgerardorodriguez asked a good question in this thread:

For my own curiosity, how is capitalize.name resolving to the proper name?

I didn't have an answer, but here is @erikjung's response (source):

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name

But now that you mention it, it's kind of silly to use name on a reference that happens to be using the same value as its own identifier. It would make more sense if we were doing this:

const helper = require('path/to/helper');

Handlebars.registerHelper(helper.name, helper);

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