Scaffolding a new React app this morning and here is the npm audit security report I got:
There are two obvious interesting ways to split your string:
If you are interested to use the spread operator, consult the following compatibility tables before you use it in your environment:
Instead of using jQuery’s .toggleClass() method to add or remove classes from an element, I can use the Element.classList.toggle() method to achieve the similar goal. The method will return true if the value is successfully added to the element class, otherwise, it will return false.
It’s a perfectly valid choice for a fairly simple application.
Filter my list of cars
Filter my list of heroes
Filter my dirty clothes…
Filter my favorite shoes…
Filter my favorite foods…
Filter the candidate to be included in my crew…
I think there is a lot of things we can filter out of an Array. A lot of things…
Have not used Array.filter() before? If yes, then consult the complete reference at MDN.
It’s cool, isn’t it? Imagine if we can tap this tool into build process to keep the codebase as clean as possible. But, if you guys also curious enough about jsinspect like myself, try to use it in your daily workflow, see how the tool can help you find the duplicate code easily.
The most important characteristic of promises is that it normalizes into predictable form how we handle the success or failure of any function call, especially if that call may be asynchronous in nature.
And in that normalization, it leaves our program in a position to control and trust how it will proceed, rather than handing that control (via a callback continuation) off to an untrustable third-party.