Any positive integer greater than one can be factored into a product of prime numbers.
Example: 1200 = 2^4 * 3 * 5^2
Write a function that takes an integer n as an argument and returns the prime factorization. The result is an object with each prime factor as a key and its exponent as the value.
var primeFactorization = function(n) {
var result = {};
for (var i=2; i <= n; i++){
while (n%i === 0){
result[i] = ++result[i] || 1;
n /= i;
}
}
return result;
}