Closed NguyenQuangMinh0504 closed 1 month ago
Javascript treat 0 as Falsey. So when the height of surface array is 0, it was actually 999. For example, the result of console.log(0 || 999) will be 999. I fix by using Nullish coalescing operator (??) instead.
console.log(0 || 999)
Wow, nice find!
Javascript treat 0 as Falsey. So when the height of surface array is 0, it was actually 999. For example, the result of
console.log(0 || 999)
will be 999. I fix by using Nullish coalescing operator (??) instead.