Factors of an integer

FCC link

Write a function that returns the factors of a positive integer as an array.

These factors are the positive integers by which the number being factored can be divided to yield a positive integer result.

Test

{{test}}

Console output