title: assigning the value of function to a variable of same name in javascript
body: <p>I was reading about hoisting, and in my editor I was trying this</p>
  <p>function loginUser() {
  return &quot;Hi&quot;}</p>
  <p>const loginUser = loginUser();</p>
  <p>I am getting the error cannot access &quot;loginUser&quot; before reinitialisation. Has it got something to do with hoisting. could I get the explanation as to why I am getting this error?</p>