Easy to understand JavaScript solution
\nvar numOfBurgers = function(tomatoSlices, cheeseSlices) {\n    if (cheeseSlices * 2 > tomatoSlices) return [];\n    if (tomatoSlices % 2 === 1) return [];\n  
```\nvar numOfBurgers = function(tomatoSlices, cheeseSlices) {\n    if (cheeseSlices * 2 > tomatoSlices) return [];\n    if (tomatoSlices % 2 === 1) return [];\n    if (tomatoSlices === 0 && cheeseSlices === 0) return [0, 0];\n\n    const maxSmallBurger = tomatoSlices / 2;\n    const jumboBurger = maxSmallBurger - cheeseSlices;\n    const smallBurger = maxSmallBurger - jumboBurger * 2;\n\n    return smallBurger >= 0 ? [jumboBurger, smallBurger] : [];\n};\n```
['JavaScript']