JS: Row randomiser

by kyllle

HTML

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css">

SCSS

* {
  -webkit-font-smoothing: antialiased;
}

body {
    padding: 5%;
}

Babel + JSX

console.clear();


var _rows = [];
for (var i = 1; i < 1000000; i++) {
	
    var bid = Math.random() * (100 - 2 + 1),
    	ask = bid - Math.random(),
        change = bid - ask,
        daysHigh = Math.random() * 100,
        daysLow = daysHigh - Math.random() * 10;

    _rows.push({
        id: i,
        symbol: 'Symbol ' + i,
        currency: 'USD',
        daysHigh : daysHigh,
        daysLow : daysLow,
        daysRange: daysLow + ' - ' + daysHigh,
        change: change,
        ask: ask,
        bid: bid
    });
}

console.log(_rows);