3 added better version
source | link

JavaScript (ES6), 44 bytes

f=(n,x=2)=>n-1?n%x?f(n,x+1):[x,...f(n/x)]:[]

Horribly inefficient due to the fact that it iterates from 2 up to every prime factor, including the last. You can cut the time complexity dramatically at the cost of 5 bytes:

f=(n,x=2)=>x*x>n?[n]:n%x?f(n,x+1):[x,...f(n/x,x)]

JavaScript (ES6), 44 bytes

f=(n,x=2)=>n-1?n%x?f(n,x+1):[x,...f(n/x)]:[]

JavaScript (ES6), 44 bytes

f=(n,x=2)=>n-1?n%x?f(n,x+1):[x,...f(n/x)]:[]

Horribly inefficient due to the fact that it iterates from 2 up to every prime factor, including the last. You can cut the time complexity dramatically at the cost of 5 bytes:

f=(n,x=2)=>x*x>n?[n]:n%x?f(n,x+1):[x,...f(n/x,x)]
2 golfed 3 bytes
source | link

JavaScript (ES6), 4744 bytes

f=(n,x=2)=>x*x>n=>n-1?[n]:n%x?f(n,x+1):[x,...f(n/x)]:[]

JavaScript (ES6), 47 bytes

f=(n,x=2)=>x*x>n?[n]:n%x?f(n,x+1):[x,...f(n/x)]

JavaScript (ES6), 44 bytes

f=(n,x=2)=>n-1?n%x?f(n,x+1):[x,...f(n/x)]:[]
1
source | link

JavaScript (ES6), 47 bytes

f=(n,x=2)=>x*x>n?[n]:n%x?f(n,x+1):[x,...f(n/x)]