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);

Your Answer

