多数の変数を null に設定したい (そして配列/ループ構造を使用したくない) と言うか、単に複数行にわたって大きなブール式を書きたいだけだとします。このような場合、閉じていない括弧はセミコロンの挿入を防ぎますか? 例えば
some_variable = another_variable = yet_another_variable = (
oh_look_a_parenthesis_above_me = hey_heres_another_variable) = (
and_for_some_reason_another = last_one) = null;
または
if(test_for_some_complex_expr && another_test || (
but_maybe_this_one && or_this_one)) {
// ...
}
また、改行を介して式をグループ化する&&
orを使用する||
場合と比較して、これはどうですか? =
つまり、これも常に機能しますか?
some_variable = another_variable =
a_variable_after_a_line_break = and_one_more;
while(test_for_an_expr && another_test ||
(an_expr_here && and_an_expr_here)) {
// ...
}
すべてのブラウザー (IE6+ を含む) で最も標準的な方法を探しています。