2

The objects have properties and methods in Javascript.

enter image description here

The primitive data types don't have properties and methods.

enter image description here

But I don't understand from where properties and methods come from of strings and numbers.

enter image description here

Jeff
  • 6,895
  • 1
  • 15
  • 33

1 Answers1

-1

It's because actually is String object.

It's internally converted to one of global objects (sorry for my terminology).

Justinas
  • 41,402
  • 5
  • 66
  • 96