Tuesday, 6 August 2013

What is a purpose of 'var a = a || { b : 1}' syntax

What is a purpose of 'var a = a || { b : 1}' syntax

I was wondering for a longer time what the below means:
var a = a || { b : 1 }
if 'a' had any properties assigned before... they dissapear. So what is a
purpose of the above syntax ?

No comments:

Post a Comment