I need to save some data in a param via Js. When I try to reuse the data, the param I get would be a proxy() obj, and I can not access the data of it. For example: in my .js file:

historyData = []

method() {
  var item = {}
  item.id = 'a'
  item.data = 'xxx'

get() {
  // here I get a proxy() object, the data is saved in originalTarget.
  this.historyData.find(item => item.id === 'a').data 

enter image description here

any solution?


This is how LWC or as a matter all Lightning components work.

Your code works fine. I created a button to check and it gave correct xxx

historyData = []

connectedCallback() {

pushToHistory() {
    var item = {};
    item.id = 'a';
    item.data = 'xxx';

handleButtonClick() {
    this.historyData.find(item => item.id === 'a').data;

Your code might be breaking elsewhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.