-1

I am using any instead of its data-type (String or Array).

just like this:

token: any

Instead of

token: String

Can anyone tell me what is the difference between both and which is best to use data-type or any?

Chrillewoodz
  • 27,055
  • 21
  • 92
  • 175

1 Answers1

0

The only difference is that if you use token: any, you don't get the benefit of type checking that helps you debug your code and prevents you from doing things like assigning a number to your token: String.

Mulperi
  • 1,450
  • 1
  • 14
  • 24