0

In JavaScript

  • Object is the only datatype (reference) which has methods
  • means we can create new methods and access the methods only from object
  • no primitive datatypes has methods
  • agreed! but in string datatype we can also access methods like toUpperCase() and other methods right ?
  • so how exactly string being a primitive datatype can access methods ? (main logic behind this implementation)

I have been learning and reading about JS , so curios about this implementation specific to String datatype Consider you are explaining this concept to a 5 year old kid / a beginner developer :-> (Keep it simple) because there are article with a lot of jargons so will be grateful if someone can put time explaining this.

0 Answers0