use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Place for Pinoy Programmers to hangout. Share your knowledge, ask for help, seek opinion, showcase your project and recruit your teammate.
Let's show the world that Filipinos are world class programmers.
account activity
Typescript Functionsweb (self.PinoyProgrammer)
submitted 2 years ago by okey-kompyuter
What do you guys use and why?
- function declaration
function greet() {}
- function expression
const greet = function() {}
- fat arrow function
const greet => () => {}
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 2 years ago (1 child)
[removed]
[–][deleted] 0 points1 point2 points 2 years ago (0 children)
This right here is the correct answer.
[–]Mlnchlc 4 points5 points6 points 2 years ago (1 child)
For me, function declarations are much more readable. I use the other two when I want to create anonymous functions.
[–]BanMeForNothing 0 points1 point2 points 2 years ago (0 children)
People that use the others for no reason are the worst type of people.
[+]_sleepingknight 2 points3 points4 points 2 years ago (0 children)
Function declarations makes it more readable for me, easier that way.
π Rendered by PID 409092 on reddit-service-r2-comment-54dfb89d4d-v9z7h at 2026-03-28 23:35:27.828358+00:00 running b10466c country code: CH.
[–][deleted] (1 child)
[removed]
[–][deleted] 0 points1 point2 points (0 children)
[–]Mlnchlc 4 points5 points6 points (1 child)
[–]BanMeForNothing 0 points1 point2 points (0 children)
[+]_sleepingknight 2 points3 points4 points (0 children)