'Why Javascript Strings has Properties and Methods, as Strings are Primitive Values [duplicate]

I am a beginner JS developer. In my class I was taught that Javascript Strings are Primitives. But also I learned there are String Properties and Methods. How is it possible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source