JS solution
Code\njavascript []\n/**\n * @param {number[][]} dimensions\n * @return {number}\n */\nvar areaOfMaxDiagonal = function(dimensions) {\n    let maxDiagonal = [];
# Code\n```javascript []\n/**\n * @param {number[][]} dimensions\n * @return {number}\n */\nvar areaOfMaxDiagonal = function(dimensions) {\n    let maxDiagonal = [];\n\n    for (let i = 0; i < dimensions.length; i++) {\n        let currDiagonal = Math.sqrt(dimensions[i][0] ** 2 + dimensions[i][1] ** 2);\n\n        maxDiagonal.push(currDiagonal);\n    }\n\n    let maxIndex = 0;\n    let maxElement = 0;\n\n    for (let i = 0; i < maxDiagonal.length; i++) {\n        if (maxDiagonal[i] > maxElement) {\n            maxIndex = i;\n            maxElement = maxDiagonal[i];\n        }\n    }\n\n    for (let i = 0; i < maxDiagonal.length; i++) {\n        if (i !== maxIndex && maxDiagonal[i] == maxElement && dimensions[maxIndex][0] * dimensions[maxIndex][1] < dimensions[i][0] * dimensions[i][1]) {\n            maxIndex = i\n        }\n    }\n\n    return dimensions[maxIndex][0] * dimensions[maxIndex][1]\n};\n```
['JavaScript']