DEV Community

Discussion on: Special kind of array in Typescript - Tuple

Collapse
 
macsikora profile image
Pragmatic Maciej

Tuple is not Array in general definition. Tuple is implemented as Array in JS as there is no Tuple in the language. In Python(and many other) for example tuple syntax is different - tuple = (1,2) and array is arr = [1,2]. The title of this article is misleading.

Collapse
 
thejsdeveloper profile image
Vikas yadav

Thank you for pointing out. I have changed the title and included Typescript as well. This article is written in context of Typescript. Yes other languages like Python have different syntax. But in Typescript we have this syntax for now. As @urielsouza29 pointed out we have already a proposal for native support for Tuple in Javascript which will have a different syntax.