I tried to write a function on a JS file and another function with the same name in the page. I expected an error but no error came and I got only the function from the
In JS you can redefine functions. A subsequent function with the same name as another function will overwrite it. (Subject to scope)