>Need help? Create an example and post the link jsfiddle.net - if you need help with HTML/CSS/JS 3v4l.org - if you need help with PHP/HackLang codesandbox.io - if you need help with React/Angular/Vue
We have our own website: wdg.one Submit your project progress updates using this format in your posts, the scraper will pick it up: :: my-project-title :: dev:: user tools:: Flutter, Php, etc link:: my.website.com repo:: github.com/user/repo progress:: Lorem ipsum dolor sit amet
...is an anonymous functions. But that line is the exact equivalent of
function foo() { return 5; }
I guess from a strict point of view, the value on the right side of the assignment is an anonymous function, but the moment that it is assign to a variable, stops being, since there is a way to reference it.
Aaron Sanchez
eating poo
Carter Scott
So those functions temporarily get a name (inferred from variable name) until the variable value is overwritten or something? Those were explicitly given as examples when I googled sround for anonymous functions
Isn’t the second one a function definition instead of function expression, too? So you can for example call it above the code that defines said function, unlike function expression? (there was something about function definition appending to Window/Global objects but I can’t remember the details)
Noah Peterson
recommended voice dictation software for programming? i want to practice it since my wrists suck.
Christopher Martin
>So those functions temporarily get a name (inferred from variable name) until the variable value is overwritten or something?
Not temporarily. As long as the scope lasts. Like I told you, both expressions are 1:1 completely equivalent. Actually, that is the exact notation that it is used with "Arrow functions"
let foo = () => 5
>Isn’t the second one a function definition instead of function expression
Call it however you want. Function expression, function definition, arrow function... at the end, they are absolute equivalents, from a programmatic point of view.
>there was something about function definition appending to Window/Global objects but I can’t remember the details
That can be done on any kind of function, no matter the way it was defined.
Ian Johnson
>at the end, they are absolute equivalents, from a programmatic point of view.
I have to correct myself there. There are some difference between arrow functions and the other kinds, when used inside JS classes. But that would be trailing off your original question.
Ethan Morgan
>Function expression, function declaration* NTA but: one is hoisted, the other is not one is parsed immediately, the other is not one can be used as an argument, the other cannot one has a name, the other does not there are slight differences in their environments and how (implicit) return works one supports recursiveness by default, expression needs to have a name added only expression can be used as IIFE
Just off the top of my head, there’s probably more
>one can be used as an argument, the other cannot Im pretty sure this is false
>one has a name, the other does not As a real anonymous function, yes. But in the example of it is being assigned to a variable, which gives it a name.
>one supports recursiveness by default, expression needs to have a name added Discussed in previous point
>only expression can be used as IIFE Again, you are missing the point of my post. I am saying that when a function expression IS ASSIGNED to a variable, it becomes a 1:1 equivalent to a function definition.
These are pirate sites so obviously you cant host something like this on AWS, Azure or any giga server providers. What do I need to create something like these without getting myself into legal troubles? as American.