Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spaced arrays in terminal and nodejs #1178

Open
SergioGabrieltrue opened this issue Sep 26, 2024 · 0 comments
Open

Spaced arrays in terminal and nodejs #1178

SergioGabrieltrue opened this issue Sep 26, 2024 · 0 comments

Comments

@SergioGabrieltrue
Copy link

Type: Bug

I don't exactly what is happening, but the output while i use the code runner is showing spaced arrays when i apply methods like .pop(), .shift(), .push() and similar.

The code itself:

let arr = [1,3,5,7,9]

let teste = arr.push(14,13,false,[])

let ultimoitem = arr.pop()

console.log(ultimoitem)
console.log(arr)

let primeiroItem = arr.shift()
console.log(primeiroItem)
console.log(arr)

teste = arr.unshift(4,5,6)
console.log(teste)

let arr2 = arr.slice(2,5)
console.log(arr2)
console.log(arr)

let arr3 = arr.splice(2,5)
console.log(arr)
console.log(arr3)

The output:
[]
[
1, 3, 5,
7, 9, 14,
13, false
]
1
[
3, 5, 7,
9, 14, 13,
false
]
10
[ 6, 3, 5 ]
[
4, 5, 6,
3, 5, 7,
9, 14, 13,
false
]
[ 4, 5, 14, 13, false ]
[ 6, 3, 5, 7, 9 ]

Note: I'm using the plug in "Code runner ".

Extension version: 0.12.2
VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Windows_NT x64 10.0.19045
Modes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant