Skip to content
Advertisement

Tag: short-circuit-evaluation

Why does this short circuit evaluation return undefined if first value is false?

I have an example similar to this where the first expression evaluates to false and the second is undefined but the overall expression returns undefined into valueResult, shouldn’t the first false value terminate the check and return false? I have added console log statements and a debugger and this is what is happening, however when I do false && undefined

Advertisement