0

Why if I write a function called close(), it doesn'work, but if I change its name it works?

https://code.sololearn.com/Wh4st9GGiaLa/?ref=app https://code.sololearn.com/WyU8ju4FBr8X/?ref=app

21st Feb 2021, 8:28 AM
RichardB
RichardB - avatar
8 ответов
+ 4
Richard What's your question? Can you elaborate
21st Feb 2021, 9:19 AM
R🍁🇮🇳
R🍁🇮🇳 - avatar
+ 3
Richard Share your code
21st Feb 2021, 8:31 AM
R🍁🇮🇳
R🍁🇮🇳 - avatar
+ 3
probably because close() is a builtin global function wich cannot be overrided (even if getOwnPropertyDescriptor return writable:true and configurable:true) ^^
21st Feb 2021, 10:11 AM
visph
visph - avatar
+ 2
Richard what is "o"?
21st Feb 2021, 8:49 AM
Abhay
Abhay - avatar
+ 1
Ok I undestand. 🇮🇳 R◉‿◉ visph thank you guys!
21st Feb 2021, 11:18 AM
RichardB
RichardB - avatar
0
I edited the comment. The only thing I have changed is the name of the function. In the first case the function closebtn() let me close the side bar. In the second code the function close() doesn't close the side bar
21st Feb 2021, 9:49 AM
RichardB
RichardB - avatar
0
Richard Check this when you are using built in function you need be careful Close() you wrote c small letter that's why https://code.sololearn.com/WT30lVmMfMi0/?ref=app
21st Feb 2021, 11:11 AM
R🍁🇮🇳
R🍁🇮🇳 - avatar
0
Close is a keyword in some Lang so you don't same name ✌️ hope you understand
22nd Feb 2021, 3:53 AM
NITIN
NITIN - avatar