js

by novikov433

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>


        const z = Math.floor(Math.random() * (500 - 0 + 1)) + 0;

        //alert(z);

        const d1 = Date.parse(new Date('1980-01-01 00:00:00'));
        const d2 = Date.parse(new Date('1995-12-31 00:00:00'));
        const dr = Math.floor(Math.random() * (d2 - d1) + d1);
        const dp = new Date(dr);
        const df = dp.toDateString(dp);
        const dff = df.split(' ');
        const dfff = (dff[2] + " " + dff[1] + " " + dff[3])


        //alert( dff[2] + " " + dff[1] + " " + dff[3]);

        var pn =['Alex', 'Mark', 'Victor', 'Maxim', 'Robert'],
            pnf = pn[Math.floor(Math.random() * pn.length)];
            
        
        //alert(pnf);

        var chislo = prompt('Введите ко-во массивов');
        var massive = [];

        for (let i=0; i < chislo; i++) {
            massive.push({
                date: (new Date(Math.floor(Math.random() * (d2 - d1) + d1))).toDateString(),
                summ: Math.floor(Math.random() * (500 - 0 + 1)) + 0,
                name: pn[Math.floor(Math.random() * pn.length)],
            });
        }
        console.table(massive);

    </script>
</body>
</html>