This file contains 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
/* | |
* [Exercício 1] | |
* | |
* Dado o seguinte vetor e utilizando somente map e reduce, | |
* somar todos os valores de produtos e utilize o console.log para ver o valor na tela. | |
*/ | |
const produtos = [ | |
{ | |
nome: 'Bicicleta', |
This file contains 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
/* | |
* [Exercício 2] | |
* | |
* Dado o seguinte vetor e utilizando somente map, reduce e filter. | |
* | |
* 2a) Gere um novo vetor com a lista de produtos cuja a quantidade seja maior que 0 | |
*/ | |
const produtos = [ | |
{ |
This file contains 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
/* | |
* [Exercício 3] | |
* | |
* Dado que a assinatura da função readdir do módulo fs é: | |
* | |
* | |
* const fs = require('fs') | |
* const path = './' | |
* fs.readdir(path, (err, files) => { | |
* if(err){ |
This file contains 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
/* | |
* [Exercício 4] | |
* | |
* Construa uma função async que utiliza a função readdirPromise com await e | |
* escreva no console a lista de arquivos/diretórios retornados. | |
*/ | |
const fs = require('fs') | |
const readdirPromise = (path) => new Promise((resolve, reject) => |
This file contains 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
/* | |
* [Exercício 5 - extra] | |
* | |
* Dado a lista de arquivos/diretórios retornada no exercício anterior, | |
* mostre quais são arquivos. | |
* (utilize fs.stat(caminho, (err, stat) => stat.isFile()) para isso.) | |
*/ | |
const fs = require('fs') |
This file contains 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
/* | |
* [Exercício 6] | |
* Utilizando o ExpressJS, crie uma rota que some 2 números enviados como | |
* parâmetros na URL. Exemplo, ao executar no navegador: | |
* http://localhost:3000/somar?num1=10&num2=30 | |
* deverá ser retornado na tela A soma é: 40. | |
*/ | |
const express = require('express') |
This file contains 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
<% include header %> | |
<h2>Calculadora</h2> | |
<form method="GET"> | |
Valor inicial: <input type="text" name="valorInicial"><br> | |
Taxa a.m.: <input type="text" name="taxa"><br> | |
Quantos meses: <input type="text" name="tempo"><br> | |
<button type="submit">Calcular</button> | |
</form> | |
<% if (resultado.calculado) { %> |
This file contains 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
<% include header %> | |
<h2>Operações</h2> | |
<table> | |
<thead> | |
<tr> | |
<th>Descrição</th> | |
<th>Valor</th> | |
<th>Sub-total</th> | |
</tr> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Meu Dinheiro</title> | |
<link href="https://fonts.googleapis.com/css?family=Raleway:400,700" rel="stylesheet"> | |
<link rel="stylesheet" href="css/styles.css"> | |
</head> | |
<body style="margin: 0"> | |
<section class="header"> | |
<img src="/images/meu-dinheiro.png"> |
This file contains 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
<% include header %> | |
<h2>Contas Mensais</h2> | |
<table> | |
<thead> | |
<tr> | |
<th>Descrição</th> | |
<th>Valor Estimado</th> | |
<th>Dia do Vencimento</th> | |
</tr> |
OlderNewer