Generating Random Numbers | WordPress.org

[ad_1]

Hello;
How can I generate 6 random numbers next to each other between 1 and 60?

Example: 05-11-17-19-55-59 (This way)

I tried something below, but it didn’t work.
Do you have any suggestions?

(function () {
    var kriter2 = '';
    var rakamlar = [];

 
    for (var i = 1; i <= 60; i++) {
        rakamlar.push(i);
    }

    rakamlar.sort(function () {
        return 0.5 - Math.random();
    });

    kriter2 = rakamlar.slice(0, 6).join('-');

    jQuery('#calculation-kriter2').html(kriter2);
    jQuery('.kriter2-aciklama').html('Kilo : ');
    jQuery('.kriter2-sonuc').html(kriter2);

    return kriter2;
})();
  • This topic was modified 2 hours, 1 minute ago by pexel.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer