Created
May 26, 2022 14:05
-
-
Save almcarvalho/1dcd16d70e6d01b52c89fb96eaeb54d4 to your computer and use it in GitHub Desktop.
Declaring a vector in Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let valores = [5]; | |
valores = [0, 1, 2, 3, 4] | |
console.log('valores'); | |
for (let index = 0; index < valores.length; index++) { | |
const element = valores[index]; | |
console.log(element); | |
} | |
let cores = Array(5); | |
cores = [0, 1, 2, 3, 4] | |
console.log('cores'); | |
for (let index = 0; index < cores.length; index++) { | |
const element = cores[index]; | |
console.log(element); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment