JavaScript Solution
Code\n\n/**\n * @param {number} n\n * @return {number}\n */\n\n\nvar nthUglyNumber = function (n) {\n    let id2 = 0\n    let id3 = 0\n    let id5 = 0\n\n    le
# Code\n```\n/**\n * @param {number} n\n * @return {number}\n */\n\n\nvar nthUglyNumber = function (n) {\n    let id2 = 0\n    let id3 = 0\n    let id5 = 0\n\n    let uglyNumbers = [1]\n\n    while (uglyNumbers.length < n) {\n        let val2 = uglyNumbers[id2] * 2\n        let val3 = uglyNumbers[id3] * 3\n        let val5 = uglyNumbers[id5] * 5\n\n        let next = Math.min(val2, val3, val5)\n        uglyNumbers.push(next)\n\n        if (next == val2) id2++\n        if (next == val3) id3++\n        if (next == val5) id5++\n\n    }\n    \n    return uglyNumbers[n-1]\n};\n\n```
['JavaScript']