I am reading a component and I found the following line:


I didn't know there was syntax like this what does it do ? I logged it and confirmed that it works, but I cant' find any docs that talk about .get with a second parameter.


It's most likely a typo or a copy-paste mistake. get only uses the first parameter, but it is not harmful to include a second parameter in JavaScript. You can try this in any flavor of JavaScript:

var f = function(x) { console.log(x); }
f(300, 500);

It is more likely that the developer intended:

component.set('v.recordId', accID);
| improve this answer | |
  • Kinda what I thought thanks! – SallyRothroat Jun 7 '19 at 17:40

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.