Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JavaScript のビットごとの1または equals 演算子を使用してポリフィルを作成することに問題はあり|=ますか?
|=
Date.now |= function() { return +new Date; };
1ビット単位の演算子参照 2Date.now()参照
Date.now()
ええと、そうですか?と の間には大きな違いが|あり||、ポリフィルは次を使用する必要があります。
|
||
Date.now = Date.now || function() {return +new Date;};
結局のところ、これを使用した場合:
Date.now = Date.now | function() {return +new Date;};
0関数を上書きすると結果が得られます。
0