Home > Enterprise >  Why is it that array outputs have a () with a number next to it in VS code?
Why is it that array outputs have a () with a number next to it in VS code?

Time:05-23

Why is it that array outputs have a () with a number next to it in VS code?

Code:

var Str = 'a string'

console.log(Str)

var Arr = [23, 'Charles']

Arr[0] = 20

console.log(Arr)

var Arr1 = ['Grace', 'Debbie', 'Debby']
Arr1[0] = 'Sophie'
console.log(Arr1)

Output:

a string
(2) [20, 'Charles']
(3) ['Sophie', 'Debbie', 'Debby']

enter image description here

  • Related