/    Sign up×
Community /Pin to ProfileBookmark

Types of Functions in Javascript

I am confused about function types in JS. How many types of functions do i need to know before i dive into the world of web development? basically, while going through you tube tutorials on JS,i found out several types of functions namely constructor functions and factory functions.
i wanted to know how many types of functions are there and what is the difference between them? do i need to learn every function in web development?

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@NachfolgerJul 29.2020 — > @bhattabbk#1621418 How many types of functions do i need to know before i dive into the world of web development?

None. You need to know none. That's what the purpose of learning is, you dive head in and learn as you go. I think you're conflating function declaration vs what a function actually is. There's tons of different ways to define a function function xyz() {} or xyz = function() {} and this list can go on for quite some time. Stay basic, follow tutorials, and learn as you go.

> @bhattabbk#1621418 do i need to learn every function in web development?

No. This would be impossible. A function is a programmer or language defined operation, you cannot simply learn every function in existence.
Copy linkTweet thisAlerts:
@VITSUSAJul 30.2020 — @bhattabbk#1621418 click on the mentioned hyperlink to know about types of the functions in JavaScript -

https://dmitripavlutin.com/6-ways-to-declare-javascript-functions/#:~:text=In%20JavaScript%20functions%20are%20first,regular%20object%20of%20type%20function%20.&text=The%20arguments%20arg1%2C%20args2%2C%20.,as%20the%20function%20body%20code.
Copy linkTweet thisAlerts:
@ravikumar11Jul 31.2020 — There are three types of Functions available in JavaScript
  • 1. Named function

  • 2. Anonymous function

  • 3. Immediately invoked function expression. It runs as soon as the browser finds it.


  • But, above as you said to dive in web development that means you are fresher in the technology industry. So, as a fresher, you don't need to know exactly all the functions in Javascript. I don't mean that you don't have to learn these functions but you can learn just there basics.
    Copy linkTweet thisAlerts:
    @james____brownAug 14.2020 — Types of functions in JavaScript
  • 1. A regular Function

  • 2. Function Expression

  • 3. Shorthand method definition

  • 4. Arrow function

  • 5. Generator function

  • 6. New Function
  • Copy linkTweet thisAlerts:
    @rpg2009Aug 14.2020 — In my opinion learning about the different function types, and we could throw in 'higher order functions' and 'recursive functions' to the list, is just the tip of the iceberg.

    Look at almost any JS book or online course and there will be lengthy chapters/sections dedicated to functions. It's something that can be over-whelming to start with, and will take time, research and practice to try and grasp — Its all well worth the effort though.

    If I think back a decade ago, and my efforts to wrap my head around JS functions, there are a few key things worth learning about.

  • 1. Function invocation in general and the processes/steps involved in that. (see link below)

  • 2. What the Execution context is

  • 3. Arguments, the scope chain and lexical scoping

  • 4. Garbage collection and 'closures'

  • 5. The difference between arguments being passed as values or by reference — This definitely threw me to begin with.

  • 6. Finally understanding that functions are basically executable objects (first class objects) that can be passed around and treated like any other piece of data.


  • [https://blog.bitsrc.io/understanding-execution-context-and-execution-stack-in-javascript-1c9ea8642dd0](url)

    Personally I think with a good grounding in these topics, understanding different ways of creating and using functions will fall into place.

    Just to add this was a link that helped me back then. Have to say it's pretty dry reading though.

    [http://jibbering.com/faq/faq_notes/closures.html](url)
    Copy linkTweet thisAlerts:
    @KIHYTDAAug 15.2020 — i wanted to know how many types of functions are there and what is the difference between them? do i need to learn every function in web development?

    [url=https://tutuapp.uno/][color=#000000]Tutuapp[/color][/url] [url=https://9apps.ooo/][color=#000000]9Apps[/color][/url] [url=https://showbox.kim/][color=#000000]ShowBox[/color][/url]
    ×

    Success!

    Help @bhattabbk spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.8,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...