functions are data in memory stack, so when you define another function with the same name, it overrides the previous one.
The second definition of an Object overwrites the first one. In general the last definition of an object overwrites all previous definitions.
Functions in JavaScript are Objects
https://stackoverflow.com/questions/33973987/why-am-i-able-to-define-same-function-twice-in-javascript
Why am I able to define same function twice in javascript?
- Otto
- Posts: 6418
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 43 times
- Been thanked: 2 times
- Contact:
Why am I able to define same function twice in javascript?
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************