# Const vs function

**URL:** <https://forum.codewithmosh.com/t/const-vs-function/19973>\
**Category:** React\
**Created:** [May 1, 2023, 12:51pm UTC](https://forum.codewithmosh.com/t/const-vs-function/19973 "2023-05-01T12:51:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GavinBaumanis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/gavinbaumanis/32/5757_2.png) [@GavinBaumanis](https://forum.codewithmosh.com/u/GavinBaumanis)\
**Post date:** [May 1, 2023, 12:51pm UTC](https://forum.codewithmosh.com/t/const-vs-function/19973/1 "2023-05-01T12:51:58Z")

</div>

Just started the new course.  
Noticed that a function is declared as a const.

Is there a “real world” issue using one over the other?  
(E.g. Hoisting issues can be negated - by using a newer / better build tool - so claiming “hoisting issues” as a reason to use CONST, seems “silly”: at least IMHO)

I am not really interested in "Under situation XX, that happens practically never, the garbage collector feels better about itself… ", either.

I have done a little googling / reading - and it seems that everyone has a different idea as to which is better and why and my opinion is “just another”.  
I think declaring with _function_ is a little cleaner / easier to read - but it is JUST a preference.

At work, we’re about to migrate an ancient (v0.13 - not even v1) Angular app to React (18) and wanted to have a definitive answer that could be implemented into a coding standard - with some real world reasoning behind it - if that is even possible.

Thanks!
