+ 1

Hello everyone. JavaScript

What does the keywords "public", "protected", "private" do? And also give me example pls

17th Oct 2017, 3:57 PM
😎_M_😎
😎_M_😎 - avatar
6 Answers
+ 3
There are no public, private or advanced variables/functions in Javascript. You are possibly confusing it with other languages.
19th Oct 2017, 12:55 PM
Private [GER]
Private [GER] - avatar
+ 1
JS marks unknown stuff purple.
19th Oct 2017, 1:03 PM
Private [GER]
Private [GER] - avatar
+ 1
Your console also says that private isn't defined.
19th Oct 2017, 1:04 PM
Private [GER]
Private [GER] - avatar
+ 1
Ok, thank you for explanation
19th Oct 2017, 1:05 PM
😎_M_😎
😎_M_😎 - avatar
+ 1
Thanks for marking as right answer :)
19th Oct 2017, 1:15 PM
Private [GER]
Private [GER] - avatar
0
But how would you explain this? Why this words are purple color instead of white? https://code.sololearn.com/WZ3LemLSrtrc/?ref=app
19th Oct 2017, 1:02 PM
😎_M_😎
😎_M_😎 - avatar