Posts Tagged ‘JSX’

Choosing Between Ternaries or && in JSX

There is always the question that runs in the mind of developers, do I choose ternaries or logical && to use in React? Personally, I always prefer logical && over ternaries to handle the truth condition. Let me explain why. Just a few days ago, I was writing the following React code: import React from […]

ES6/JSX Code Coverage with Istanbul/NYC

Background In computer science, code coverage is a measurement of how many lines/blocks/arcs of your code are executed while the tests are running. A code coverage system collects information about the running program and then combines that with source information to generate a report on the test suite’s code coverage. Issue You’ve got some experience […]