我对这段代码感到有点困惑。我非常感谢一步步走过。
i = 0;
!(i % 3 && i % 5) && arr.push(i), i++
答案 0 :(得分:0)
一步一步演练:
i = 0; // assignment of 0 to the global variable i//
!// the opposite of the following expression, note does not apply to
//expression not in parentheses below //
(i % 3 && i % 5) // returns
//true if i does
// equal zero for both i % 3 and i % 5 // in javascript 0 is a falsy
//value
&& arr.push(i) // returns true if the length property of arr is not
// 0, i++