First I couldn't figure out what the last line means. Why would you compare left, right and cur? Finally I got it. I think it would be better if you explain this a bit. left represents that if the next level ends up with the left-child node, what its width would be. The right is the corresponding meaning. If the child node is null, 0 will be returned. So Math.max(left, right) just means the next level's width and cur is that of the current level.
Maximum Width of Binary Tree