Array.from vs Filter vs [...]

Edit on GitHub

Setup

const collection = document.querySelector('p')

Tests

  • Array.from

    const collection = document.querySelector('p')
    Array.from(collection).filter(node => node)
  • Filter

    const collection = document.querySelector('p')
    Array.prototype.filter.call(collection, node => node)