(Math.Floor (Math.Random () * 90000) 10000) .ToString ();

var val = Math.floor(1000 + Math.random() * 9000);
console.log(val);
Nikita Gourevitch