javascript - How to generate three-digit numbers with js, where each number is an even number, and output all qualified numbers to the console?
三叔
三叔 2017-06-12 09:32:26
0
4
929

How to generate three-digit numbers using js, where each number is an even number?

三叔
三叔

reply all(4)
某草草
var a=2*Math.ceil(4*Math.random())
var b=2*Math.floor(5*Math.random())
var c=2*Math.floor(5*Math.random())
console.log(eval(a+''+b+''+c))

Before, I only looked at the content, not the title.
The following is the output of all those that meet the requirements

var arr=Array(900).fill(0).map((e,i)=>i+100)
      .filter(e=>/[2468][24680]{2}/.test(e.toString()))

      console.log(arr)
学习ing
for(let i=2; i<=8; i=i+2){
    for(let j=0; j<=8; j=j+2){
        for(let k=0; k<=8; k=k+2){
            console.log("" + i + j + k)
        }
    }
}
扔个三星炸死你
    var arr=[0,2,4,6,8];
        function randomNum(){
            var fistnum=Math.floor(Math.random()*4+1);
            var secnum=Math.floor(Math.random()*5);
            var thrnum=Math.floor(Math.random()*5);
            var num=fistnum*100+secnum*10+thrnum;
            return num;
        }
给我你的怀抱

function randomNumber(min,max){

var range = max-min;
var rand = Math.random();
var result = min+Math.round(rand*range);
return parseInt(result/100) == parseInt((result%100)/10) && (parseInt(result/100) == parseInt(result%10))?parseInt(result/100)%2 == 0 && parseInt((result%100)/10)%2 ==0  && result%10%2== 0?result:0:0;

}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template