Chikwado Posted June 9, 2016 Share Posted June 9, 2016 Some one help with cue. What is difference between this function: function F(){} and againvar F = function(){} some one help. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 9, 2016 Share Posted June 9, 2016 The major difference is that the first definition gets hoisted, and the second doesn't. There's a description about that here: http://davidbcalhoun.com/2011/different-ways-of-defining-functions-in-javascript-this-is-madness/ Link to comment Share on other sites More sharing options...
kodejuice Posted June 16, 2016 Share Posted June 16, 2016 The first one could be called anywhere within the scope it is defined in, while the second can not. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now