<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
let data = {
"name": "MARKET",
"values": [{
"time": 1440338400000,
"close": 0.142163,
"high": 0.152869,
"low": 0.142163,
"open": 0.152221,
"volume": 14.2163,
"marketCap": 0
}, {
"time": 1440511200000,
"close": 0.158082,
"high": 0.161828,
"low": 0.15139,
"open": 0.154371,
"volume": 441.882,
"marketCap": 0
}, {
"time": 1440597600000,
"close": 0.162958,
"high": 0.165483,
"low": 0.15688,
"open": 0.158235,
"volume": 335.53,
"marketCap": 0
}, {
"time": 1440684000000,
"close": 0.16487,
"high": 0.167594,
"low": 0.160171,
"open": 0.162908,
"volume": 492.134,
"marketCap": 0
}, {
"time": 1440770400000,
"close": 0.162612,
"high": 0.166171,
"low": 0.162327,
"open": 0.164979,
"volume": 81.1436,
"marketCap": 0
}, {
"time": 1440856800000,
"close": 0.156701,
"high": 0.161385,
"low": 0.155568,
"open": 0.161316,
"volume": 514.921,
"marketCap": 0
}, {
"time": 1440943200000,
"close": 0.144589,
"high": 0.157018,
"low": 0.141987,
"open": 0.156943,
"volume": 635.154,
"marketCap": 0
}, {
"time": 1441029600000,
"close": 0.145655,
"high": 0.146195,
"low": 0.142581,
"open": 0.144715,
"volume": 10.1958,
"marketCap": 0
}, {
"time": 1441116000000,
"close": 0.142958,
"high": 0.146204,
"low": 0.142701,
"open": 0.145595,
"volume": 0.544275,
"marketCap": 0
}, {
"time": 1441202400000,
"close": 0.148987,
"high": 0.148987,
"low": 0.141326,
"open": 0.142983,
"volume": 58.1051,
"marketCap": 0
}, {
"time": 1441288800000,
"close": 0.15025,
"high": 0.150856,
"low": 0.148987,
"open": 0.148987,
"volume": 34.4072,
"marketCap": 0
}, {
"time": 1441375200000,
"close": 0.155935,
"high": 0.156681,
"low": 0.15228,
"open": 0.152503,
"volume": 0.155935,
"marketCap": 0
}, {
"time": 1441461600000,
"close": 0.159049,
"high": 0.160032,
"low": 0.155711,
"open": 0.155836,
"volume": 0.159049,
"marketCap": 0
}, {
"time": 1441634400000,
"close": 0.163826,
"high": 0.16474,
"low": 0.162861,
"open": 0.164304,
"volume": 327.651,
"marketCap": 0
}, {
"time": 1441720800000,
"close": 0.124591,
"high": 0.16437,
"low": 0.124427,
"open": 0.163697,
"volume": 1558.32,
"marketCap": 0
}, {
"time": 1441807200000,
"close": 0.115118,
"high": 0.125665,
"low": 0.115,
"open": 0.124679,
"volume": 110.436,
"marketCap": 0
}, {
"time": 1441893600000,
"close": 0.10203,
"high": 0.115274,
"low": 0.101593,
"open": 0.115047,
"volume": 1795.72,
"marketCap": 0
}, {
"time": 1441980000000,
"close": 0.101996,
"high": 0.102003,
"low": 0.101886,
"open": 0.102003,
"volume": 1795.14,
"marketCap": 0
}, {
"time": 1442066400000,
"close": 0.104842,
"high": 0.106246,
"low": 0.104305,
"open": 0.106246,
"volume": 2.09684,
"marketCap": 0
}, {
"time": 1442152800000,
"close": 0.105386,
"high": 0.106185,
"low": 0.103682,
"open": 0.104886,
"volume": 2192.04,
"marketCap": 0
}, {
"time": 1442239200000,
"close": 0.102747,
"high": 0.114521,
"low": 0.102498,
"open": 0.105317,
"volume": 21.0632,
"marketCap": 0
}, {
"time": 1442325600000,
"close": 0.0736399,
"high": 0.105086,
"low": 0.0697372,
"open": 0.102713,
"volume": 863.28,
"marketCap": 0
}, {
"time": 1442412000000,
"close": 0.0805882,
"high": 0.0805882,
"low": 0.0736,
"open": 0.073644,
"volume": 79.9028,
"marketCap": 0
}, {
"time": 1442498400000,
"close": 0.0882002,
"high": 0.0885284,
"low": 0.0805882,
"open": 0.0805882,
"volume": 52.9201,
"marketCap": 0
}, {
"time": 1442584800000,
"close": 0.102387,
"high": 0.102535,
"low": 0.0878508,
"open": 0.0881813,
"volume": 738.121,
"marketCap": 0
}, {
"time": 1442671200000,
"close": 0.102663,
"high": 0.10276,
"low": 0.102129,
"open": 0.102387,
"volume": 10.2663,
"marketCap": 0
}, {
"time": 1442757600000,
"close": 0.104525,
"high": 0.106224,
"low": 0.104265,
"open": 0.106224,
"volume": 72.0357,
"marketCap": 0
}, {
"time": 1442844000000,
"close": 0.109941,
"high": 0.110287,
"low": 0.104422,
"open": 0.104472,
"volume": 5.49706,
"marketCap": 0
}, {
"time": 1442930400000,
"close": 0.109915,
"high": 0.110532,
"low": 0.109467,
"open": 0.110108,
"volume": 5.49574,
"marketCap": 0
}, {
"time": 1443016800000,
"close": 0.115694,
"high": 0.116243,
"low": 0.113882,
"open": 0.114151,
"volume": 23.1389,
"marketCap": 0
}, {
"time": 1443103200000,
"close": 0.116584,
"high": 0.116939,
"low": 0.115274,
"open": 0.115608,
"volume": 23.3168,
"marketCap": 0
}, {
"time": 1443189600000,
"close": 0.119464,
"high": 0.119717,
"low": 0.118964,
"open": 0.119519,
"volume": 11.9464,
"marketCap": 0
}, {
"time": 1443276000000,
"close": 0.122498,
"high": 0.122824,
"low": 0.118839,
"open": 0.119362,
"volume": 12.2498,
"marketCap": 0
}, {
"time": 1443362400000,
"close": 0.125336,
"high": 0.125755,
"low": 0.122345,
"open": 0.122539,
"volume": 12.5336,
"marketCap": 0
}, {
"time": 1443535200000,
"close": 0.118549,
"high": 0.119365,
"low": 0.118333,
"open": 0.119131,
"volume": 1460.31,
"marketCap": 0
}, {
"time": 1443621600000,
"close": 0.120841,
"high": 0.121297,
"low": 0.118471,
"open": 0.118521,
"volume": 12.0841,
"marketCap": 0
}, {
"time": 1443708000000,
"close": 0.121266,
"high": 0.121307,
"low": 0.120696,
"open": 0.120696,
"volume": 12.1266,
"marketCap": 0
}, {
"time": 1444053600000,
"close": 0.124926,
"high": 0.125369,
"low": 0.122085,
"open": 0.122188,
"volume": 0.249852,
"marketCap": 0
}, {
"time": 1444140000000,
"close": 0.124018,
"high": 0.12524,
"low": 0.124018,
"open": 0.124926,
"volume": 0.248037,
"marketCap": 0
}, {
"time": 1444312800000,
"close": 0.127015,
"high": 0.12717,
"low": 0.126854,
"open": 0.127056,
"volume": 269.89,
"marketCap": 0
}, {
"time": 1444399200000,
"close": 0.129375,
"high": 0.129437,
"low": 0.126736,
"open": 0.126915,
"volume": 12.9375,
"marketCap": 0
}, {
"time": 1444485600000,
"close": 0.129097,
"high": 0.129523,
"low": 0.129063,
"open": 0.12927,
"volume": 12.9097,
"marketCap": 0
}]
};
for (let i = data.values.length - 1; i > 0; i--) {
let timeDifference = data.values[i].time - data.values[i-1].time;
timeDifference = timeDifference / 86400000;
if (timeDifference > 1) {
console.log(timeDifference, i, data.values.length)
for (x = 1; x < timeDifference; x++) {
let date = new Date(data.values[i].time)
console.log(date.toString())
data.values.splice(i, 0, data.values[i-1]);
data.values[i].time += x * 86400000;
date = new Date(data.values[i].time)
console.log(date.toString())
}
}
}
data.values.forEach(value => {
let date = new Date(value.time)
//console.log(date.toString())
})
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |