Difference between function name() and name = function()?

hi guys, just wondering if theres a difference between using

function x() {

}

and

x = function(){

}

i find sometimes,but rarely function x() will not run while the other will??