Comment 9 for bug 1582720

Revision history for this message
Jason Boyer (jboyer) wrote :

They are fairly bad param names and indeed 2 (rather, 4) of them are unused; the number of params comes from here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach . The forEach callback function is called with 3 params: the current element, index of the element in the array, and the array itself (so element = array[index]) and since it's called with all 3, I named all three. They're not helpful for this, but I don't really like accepting only 1 param when the callback will be given 3.
To distinguish the generic params given the suffixes try to indicate what goes where, so elb is the forEach element from bibSummary.uris, and els is the forEach element of the summary.eResourceUrls. The names are a bit short because they're only used in 3-4 lines all together (were it only called once I'd probably reach for elm, idx, and ary) but they can be changed if there's a desire from the reviewers and / or newdevs groups to make them more clear.