can the name of function be the same with name of variable js

Solutions on MaxInterview for can the name of function be the same with name of variable js by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "can the name of function be the same with name of variable js"
Mayssa
18 Jan 2021
1If you use a function name as variable name, its value is replaced by 
2function body. 
3So var a becomes your function a and thus your alert displays function a.
4
5Edit But if you assign value to a like var a = "xya";. 
6Then it function will be replaced by variable. As per Order of 
7precedence
8
9!!Variable assignment takes precedence over function declaration!!
10!!Function declarations take precedence over variable declarations!!
11