Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

Why are my JavaScript objects equal to Proxy {}

Asked by Debbie Jha Apr 23, 2021 1.9K views 1 answer
Share

About this question

I am loading a JavaScript object between Lightning Components

var model = {} model.user = {} model.caller = {} model.caller.name = 'Batman'; model.other = {} // etc
And then into component attributes.
cmp.set("v.model", model); cmp.set("v.caller", model.caller);
Then I use then like this:

Then I get data back out:
model.caller = cmp.get("v.caller");

My question is:

Why do my JavaScript{} object sub-objects sometimes get set to Proxy when I inspect them in the console:

caller: Proxy [[Handler]]: e [[Target]]: Object [[IsRevoked]]: false

And other times I get the values I expect...

caller { name : "Bruce Wayne" }

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.