Search code examples
javascriptoopscopereserved-words

JavaScript: Public, Private, Protected


I always thought "Public", "Private", and "Protected" keywords were for PHP or Java, not JavaScript but just found out these are reserved words.

Can anyone give me an example of how or when to use these particular reserved words because I have never seen or used them in JavaScript but would like to know when to use them.

Thank you


Solution

  • These are reserved for possible future use. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Reserved_Words