Snippets
A collection of my favourite code, including native functions, methods, and CSS properties.
CSS
The object-fit CSS property specifies how the contents of a replaced element, such as an or
JS
If object doesn't exist create one
if (!obj[d]) { obj[d] = {} obj[d][n.subject] = {id: n.id, views: n.views} } else { obj[d][n.subject] = {id: n.id, views: n.views} }
Is the same as:
const day = obj[d] || (obj[d] = {}) day[n.subject] = {id: n.id, views: n.views}