mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
1d689888b0
* Updated package json but not updated source files * Update eslint plugin * updated files
6 lines
229 B
TypeScript
6 lines
229 B
TypeScript
// Returns the factors of a number
|
|
// Example getFactors(12) -> [1, 2, 3, 4, 6, 12]
|
|
export default function getFactors(num: number): number[] {
|
|
return Array.from(new Array(num + 1), (_, i) => i).filter((i) => num % i === 0);
|
|
}
|