I found an answer for the Two Sum question on leetcode; the solution used || between obj[delta] || obj[delta]. Does anyone know why they used it in this way and what does it mean?
for(let i = 0; i< nums.length; i++) {
let cur = nums[i];
let delta = target - cur;
if(obj[delta] || obj[delta] === 0) {
return [obj[delta], i];
}
obj[cur] = i;
}