What is the difference Array and string[]?

There’s no difference between the two, it’s the same.

It says this in the docs:

Array types can be written in one of two ways. In the first, you use
the type of the elements followed by [] to denote an array of that
element type:

let list: number[] = [1, 2, 3];

The second way uses a generic array type, Array:

let list: Array<number> = [1, 2, 3];

You do need to use the Array<T> form when you want to extend it for example:

class MyArray extends Array<string> { ... }

but you can’t use the other form for this.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)