Skip to content

Instantly share code, notes, and snippets.

View allangrds's full-sized avatar
🎯
Focusing

Allan Ramos allangrds

🎯
Focusing
View GitHub Profile
@allangrds
allangrds / date-object-to-primitive-conversion.js
Last active November 5, 2018 22:13 — forked from samoshkin/date-object-to-primitive-conversion.js
Date assumes string conversion as a default
let d = new Date();
// obtém a representação em string
let str = d.toString(); // 'Wed Jan 17 2018 16:15:42'
// obtém a representação numérica, número em milisegundos desde a época do Unix
let num = d.valueOf(); // 1516198542525
// comparara com uma representação de string
// é true, pois "d" foi convertido para a mesma string
window.setInterval(
() => document.querySelectorAll('.build-status.failed')
.forEach(build => {
console.log('Restarting build')
document.querySelector('.action-button--restart').click()
}),
5000
)