I have the following code in a Javascript
function(proposal){
var items = (this.editor, []);
proposals || (proposals = []), items.push(....
I would guess items
is declared as array. But than why do I have the brackets? When I try it on the regular console than I would get items=[]
. And what is the benefit to include this.editor
? Hmmmm... is there anything declared additionally?
And the sense of the second line? I agree that if proposal
is undefined
than it would be []
. But this makes for me only sense in the context of a variable declaration. Since it is in an own line does this statement make any kind of sense?