Rxjs 里 filter(Boolean) 的用法
生活随笔
收集整理的這篇文章主要介紹了
Rxjs 里 filter(Boolean) 的用法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
StackOverflow 上的討論:
https://stackoverflow.com/questions/53953015/using-rxjs-with-filterboolean-for-queries
一個例子:
其實,這種寫法等價于:
filter(v=>!!v)The Boolean global reference points to the constructor function which returns a boolean value from the first argument.
The constructor can be used to create a boolean wrapper object, but it is not the same as the primitive true value.
console.log(new Boolean("truthy")); // prints an object.console.log(new Boolean("truthy").valueOf() === true); // prints trueconsole.log((new Boolean("truthy")) === true); // prints falseconsole.log(Boolean("truthy") === true); // prints true總結
以上是生活随笔為你收集整理的Rxjs 里 filter(Boolean) 的用法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SAP Spartacus 事件服务 E
- 下一篇: 荒野大镖客阿拉伯马位置(红色阿拉伯马在哪