diff --git a/entrega/Exercicio1.js b/entrega/Exercicio1.js new file mode 100644 index 0000000..13ffc49 --- /dev/null +++ b/entrega/Exercicio1.js @@ -0,0 +1,4 @@ +let rainbow = ["Red", "Orange", "Blackberry", "Blue"]; +rainbow.splice(2,1, "Yellow", "Green"); +rainbow.push("Purple"); +console.log(rainbow); \ No newline at end of file diff --git a/entrega/Exercicio2.js b/entrega/Exercicio2.js new file mode 100644 index 0000000..a49ff06 --- /dev/null +++ b/entrega/Exercicio2.js @@ -0,0 +1,6 @@ +let reverseMe = ["h", "e", "l", "l", "o"]; + +//reverse() é um uma função para reverter o array. join("") é uma função para juntar o array mas apenas o que há entre as "". +//criei outra variável para reverter o array reverseMe +let inverterTexto = reverseMe.reverse().join(""); +console.log(inverterTexto); \ No newline at end of file diff --git a/entrega/Exercicio3.js b/entrega/Exercicio3.js new file mode 100644 index 0000000..6f63cb7 --- /dev/null +++ b/entrega/Exercicio3.js @@ -0,0 +1,9 @@ + +//Use a função Array.prototype.reduce() "https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" +function someOsNumeroDaArray(){ + const somandoNumeroArray = [1, 2, 3, 4, 5]; + const reducer = (accumulator, currentValue) => accumulator + currentValue; + console.log(somandoNumeroArray.reduce(reducer)); + +} +someOsNumeroDaArray(); \ No newline at end of file diff --git a/entrega/Exercicio4.js b/entrega/Exercicio4.js new file mode 100644 index 0000000..53e4893 --- /dev/null +++ b/entrega/Exercicio4.js @@ -0,0 +1,9 @@ + +let pessoa = { + nomeCompleto: "Luana Cristina de A Silva", + idade: 38, + altura: 168, + metrosCaminhadosPorDia: 4000, + +} +console.log(pessoa); \ No newline at end of file diff --git a/entrega/Exercicio5.js b/entrega/Exercicio5.js new file mode 100644 index 0000000..942fd46 --- /dev/null +++ b/entrega/Exercicio5.js @@ -0,0 +1,17 @@ + +let pessoa = { + nomeCompleto: "Luana Cristina de A Silva", + idade: 38, + altura: 168, + metrosCaminhadosPorDia: 4000, + apresentacao: function exibirApresentacao() { + if(this.idade !== 1 && this.metrosCaminhadosPorDia !== 1){ + return ("Olá, eu sou " + this.nomeCompleto + ", tenho " + this.idade + " anos, minha altura é " + this.altura + " e só hoje, eu já caminhei " + this.metrosCaminhadosPorDia + " metros."); + }else{ + return ("Olá, eu sou " + this.nomeCompleto + ", tenho " + this.idade + " ano, minha altura é " + this.altura + " e só hoje, eu já caminhei " + this.metrosCaminhadosPorDia + " metro."); + } + +} + +}; +pessoa.apresentacao(); \ No newline at end of file