Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:56:46+00:00 2026-06-03T14:56:46+00:00

I notice that when using lambdas: { name: Willy, wrapped: function() { return function(text)

  • 0

I notice that when using lambdas:

{
  "name": "Willy",
  "wrapped": function() {
    return function(text) {
      return "<b>" + render(text) + "</b>"
    }
  }
}

a second argument (in addition to text) is passed in. This second argument is a function:

function (template) {
    return render(template, scope);
}

which returns html, given a template (with the inital input json object).

so, if I were to have the lambda as follows:

"wrapped": function() {
  return function(text, func) {
    ....
}

one would expect func("<div>{{name}}</div>") to return html representing a div with the content being filled in with whatever was in the ‘name’ property of the json data object.

HOWEVER, func("{{.}}") does NOT work.
I would expect the object representing the initial input object.

Instead I get the STRING "[object Object]". When I try to use JSON.parse it gives me an ‘Unexpected token o’ error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:56:49+00:00Added an answer on June 3, 2026 at 2:56 pm

    The code you are trying to parse as JSON isn’t actually JSON. It’s just a JavaScript object literal. So when you try to put {{.}} into your template, you are rightly getting [object Object] because that is the string representation of the object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I notice that many of the WPF MVVM frameworks seem to avoid using the
when using the module pattern in js i've notice that the main benefits are
How can I hide the scrollbar of using css/jQuery? I notice that the slideDown()
I am using PHP mail() to send daily notice emails. But I noticed that
I notice that when using my touch-screen smartphone (no physical keyboard) that when an
I'm drawing 2D shapes with OpenGL. They aren't using that many polygons. I notice
We have lots of workflow in our system. We notice that using WorkflowInvoker.Invoke(myworkflow) was
I was looking up the getopt command and I discovered that using the function
Every now and then, I notice that I'm using a block to iterate over
I am using Twitter bootstrap for Rails/SASS and have notice that it applies a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.