redull
redull library exported as a node.js module
Installation
npm install redull
Usage
const foo = (response !=null && response.data !=null && response.data.item !=null && response.data.item.id != null) ? response.data.item.id : ''
Instead of above condition, you can use below
Scenario 1:
This will return the actual value
import redull from 'redull' const response = const foo = ;// result will be `F56Gh`
Scenario 2:
This will return undefined
instead of breaking the code.
import redull from 'redull' const response = const foo = ;// result will be `undefined`