Try this:
var rr=(Math.floor(Math.random()*10));
result=(rr==6)?1:rr;
Edit:
The probability of 1 is not likely other, so I made it to recursive if it generate 6.
function notSix() {
var rr=(Math.floor(Math.random()*10));
return (rr==6)?notSix():rr;
}
notSix()
Correcting the first example:
generating between 0-8 first and if outputs 6 converting to 9;
var rr=(Math.floor(Math.random()*9));
result=(rr==6)?9:rr;