XARZU
New Coder
I thought I would start a helpful discussion of javascript Functions. Knowing Functions well I think would be helpful for understanding javascript.
Specifically, Functions are Objets in javascript. This is a departure from typical coding where functions are methods of a class.
Mozilla says "In JavaScript, functions are first-class objects, because they can be passed to other functions, returned from functions, and assigned to variables and properties. They can also have properties and methods just like any other object."
Visual code says:
// Functions are also known as anonymous functions. Anonymous functions are functions that have no name.
// Anonymous functions are functions that have no name.
That is interesting but it leads to questionis.
1. If Functions are objects, do they need to be instantiated?
2. In what sort of scenerio would you want to pass a function to another function?
If Functions are anoymous functions. Then what are "functions"?
Specifically, Functions are Objets in javascript. This is a departure from typical coding where functions are methods of a class.
Mozilla says "In JavaScript, functions are first-class objects, because they can be passed to other functions, returned from functions, and assigned to variables and properties. They can also have properties and methods just like any other object."
Visual code says:
// Functions are also known as anonymous functions. Anonymous functions are functions that have no name.
// Anonymous functions are functions that have no name.
That is interesting but it leads to questionis.
1. If Functions are objects, do they need to be instantiated?
2. In what sort of scenerio would you want to pass a function to another function?
If Functions are anoymous functions. Then what are "functions"?
Last edited: