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

exercicios-rian #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions exercicio1/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const arrayNumbers = [8, 12, 52, 47]
const arrayStrings = ["john", "paul", "george"]
const arraySort = [71, "revolver", true]

console.log(arrayNumbers)
console.log(arrayStrings)
console.log(arraySort)
3 changes: 3 additions & 0 deletions exercicio2/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
25 changes: 24 additions & 1 deletion exercicio2/script.js
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
const minhaString = "Eu não sou supersticioso, mas sou um pouco ________. ";
//arrays
const arrayNumbers = [8, 12, 52, 47]
const arrayStrings = ["john", "paul", "george"]
const arraySort = [71, "revolver", true]

//impressões
console.log(arrayNumbers)
console.log(arrayStrings)
console.log(arraySort)

//length
console.log("length", arrayNumbers.length)
console.log("length", arrayStrings.length)
console.log("length", arraySort.length)

//itens
console.log("item", arrayNumbers[0])
console.log("item", arrayStrings[1])
console.log("item", arraySort[2])

//includes

console.log("includes", arrayNumbers.includes(52))
console.log("includes", arrayNumbers.includes(false))
3 changes: 3 additions & 0 deletions exercicio3/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
47 changes: 47 additions & 0 deletions exercicio3/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//arrays
const arrayNumbers = [8, 12, 52, 47]
const arrayStrings = ["john", "paul", "george"]
const arraySort = [71, "revolver", true]

/* //impressões
console.log(arrayNumbers)
console.log(arrayStrings)
console.log(arraySort)

//length
console.log("length", arrayNumbers.length)
console.log("length", arrayStrings.length)
console.log("length", arraySort.length)

//itens
console.log("item", arrayNumbers[0])
console.log("item", arrayStrings[1])
console.log("item", arraySort[2])

//includes

console.log("includes", arrayNumbers.includes(52))
console.log("includes", arrayNumbers.includes(false)) */

//cópias

const copyArrayNumbers = arrayNumbers.slice()
const copyArrayStrings = arrayStrings.slice()
const copyArraySort = arraySort.slice()


//manipulação

copyArrayNumbers.push(69)
console.log("cópia numbers", copyArrayNumbers)
console.log("original numbers", arrayNumbers)

copyArrayStrings.pop()
console.log("cópia strings", copyArrayStrings)
console.log("original strings", arrayStrings)

copyArraySort.splice(1, 1)
console.log("cópia sort", copyArraySort)
console.log("original sort", arraySort)