What\'s the difference between | and || in Javascript?
Furthermore, what\'s the difference between & and &&<
one more point i want to add is || operator is used to assign default value in case the value you are assigning is undefined. So for Exapmle you are assigning a obj to some object test and if you dont want test to be undefined then you can do the following to ensure that value of test wont be undefined.
var test = obj || {};
so in case obj is undefined then test's value will be empty object.
So it is also being used for assigning default value to your object.