I was searching a lot about short circuit, but I have a big doubt with this code.
const getClient = (userInfoContext) => {
const context = userInfoContext && userInfoContext.get()
const payload = context && context.payload && context.payload['www.payload.com']
return payload && payload.clientId
}
I want to know what is the benefit of write the code like that instead of:
const getClient = (userInfoContext) => {
const context = userInfoContext.get()
const payload = context.payload['www.payload.com']
return payload.clientId
}