I have two small examples code:
// example 1:
var x;
...
x = x || 'some value'; //assign some value to x if x has no value
...
// example 2:
var y;
...
y || (y = 'some value'); //assign some value to y if y has no value
...
My question is:
1. Will x be reassign it's value in example 1 when x already has value?
2. Is example 2 better then example 1?
(My english isn't good. Thanks for your reading and answering :D)