Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
How to bind `this` into an function argument

I have search and try few method, like directly using app.shadow.dialogue({...}.bind(this)) but getting this error

Uncaught TypeError: {(intermediate value)(intermediate value)}.bind is not a function

And trying to do this instead

let dialogue = {
  "title": {
    "text": "Kembali ke tes?",
    "description": "Anda memiliki tes yang masih berlangsung"
  },
  "actions": [
    {
      "text": "Ya",
      "class": "bg-safe",
      "icon": "refresh",
      "action": "direct/tes"
    },{
      "text": "Tidak, Lihat Hasil Sebelumnya",
      "class": "bg-danger",
      "icon": "close",
      "action": function() {
        app.shadow.stop();
        this.view();
      }
    }
  ]
};

dialogue.actions[1].action.bind(this);
app.shadow.dialogue(dialogue);

but this.view still not get into scope

Uncaught TypeError: this.view is not a function

Is there a way to make this statement useable inside an object argument?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

may be you can try :

`
"action":()=> {
        app.shadow.stop();
        this.view();
      }`

hope this is useful for you.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!