The web page I created to calculate the number of possible 3-digit numbers using only the digits 1 - 6 in ascending order is not loading. I suspect there may be an error in the while loop section of the code below. I attempted to replicate the same output as the string '{a:4, b:5, c:6}', but encountered issues with it. Similarly, using 'a:4, b:5, c:6' also did not yield the desired results.
var n = 0;
var o = {a:1, b:2, c:3};
var i = [o.a, o.b, o.c];
var s = i.sort(function(a, b) {
return a - b;
});
while (o != {a:4, b:5, c:6}) {
o.c++;
i = [o.a, o.b, o.c];
if (o.c = 7) {
o.c = 1;
o.b++;
}
if (o.b = 7) {
o.b = 1;
o.a++
}
if (i == s && o.a != o.b && o.a != o.c) {
n++;
document.getElementById('a').innerHTML = n;
}
}
Furthermore, someone's suggested question differs from mine. While I am focused on resolving the issue of the page not loading and fixing the while loop, the other individual raised a query regarding why two empty objects are not considered identical.