FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour Why am I able to define same function twice in javascript?
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Why am I able to define same function twice in javascript?
Posted: Mon Sep 26, 2022 09:59 AM
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

Continue the discussion