Skip to content

How to call String.prototype.trim (or any other prototype function) as shown in the documentation example?Β #1748

@tbinna

Description

@tbinna

Before filing issues, please check the following points first:

This will probably help you to get a solution faster.
For bugs, it would be great to have a PR with a failing test-case.

I have been trying the example from the docs calling String.prototype.trim to work, but it does not seem to return the desired result (https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access).

https://jsfiddle.net/3yahoj1d/

Can anyone explain why the result prints as [object Object] to the console when typeof result returns string, or how to get the example to work?

I have also asked this on StackOverflow (https://stackoverflow.com/q/67416982/5115898) so feel free to close this issue if this is not a problem with handlebars itself.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions