Why am I able to define same function twice in javascript?

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Why am I able to define same function twice in javascript?

Postby Otto » Mon Sep 26, 2022 9: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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 7 guests