Skip to content

Commit a5e7a49

Browse files
committed
29. Desafio troca de valores
1 parent 25972dc commit a5e7a49

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
- [26. Trabalhando com dados 04](#26-trabalhando-com-dados-04)
3333
- [27. Desafio Área da Circunferência](#27-desafio-área-da-circunferência)
3434
- [28. Desafio área da circunferência - Resposta](#28-desafio-área-da-circunferência---resposta)
35+
- [29. Desafio troca de valores](#29-desafio-troca-de-valores)
3536

3637
## Seção 1: Introdução Curso Desenvolvimento Web
3738

@@ -245,4 +246,10 @@ Bons estudos e até a próxima!
245246

246247
[Arquivo](fundamentos/inicio/desafio_area_resposta.js)
247248

249+
[Commit](https://github.com/Alexandresl/Web-Moderno-com-JavaScript/commit/25972dcdd50fdaaa185120b26c42dd0b6690fa32)
250+
251+
### 29. Desafio troca de valores
252+
253+
[Arquivo](fundamentos/inicio/desafio_troca.js)
254+
248255
[Commit]()

fundamentos/inicio/desafio_area_resposta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
const PI = 3.141592;
9-
let raio = window.prompt("Digite o raio");
9+
const raio = 10;
1010
const areaCirc = PI * raio * raio;
1111

1212
console.log("O valor da área é " + areaCirc + "m²");

fundamentos/inicio/desafio_troca.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
let a = 7;
2+
let b = 94;
3+
4+
// Depois da troca... a = 94 e b = 7
5+
6+
let temp = a;
7+
a = b;
8+
b = temp;
9+
10+
console.log("a = " + a);
11+
console.log("b = " + b)

0 commit comments

Comments
 (0)