Nestes exercícios iremos exercitar os métodos auxiliares para array:
- forEach
- map
- filter
Altere o código a seguir para utilizar a função forEach
de modo que a saída permaneça a mesma.
import { useEffect, useState } from "react"; | |
// id, size, x, y, opacity, animationDuration | |
// id, size, x, y, delay, animationDuration | |
export const StarBackground = () => { | |
const [stars, setStars] = useState([]); | |
const [meteors, setMeteors] = useState([]); | |
useEffect(() => { |
print("*******************************") | |
print(" GERENCIADOR DE TAREFAS ") | |
print("*******************************") | |
print("Qual ação você gostaria de executar?") | |
print("Opção 0 : Sair") | |
print("Opção 1 : Adicionar nova tarefa") | |
print("Opção 2 : Ver todas as tarefas pendentes") | |
print("Opção 3 : Concluir uma tarefa pendente") | |
print("Opção 4 : Ver todas as tarefas concluidas") |
import { useEffect, useState } from 'react' | |
import './App.css' | |
import axios from 'axios'; | |
type Character = { | |
image: string; | |
name: string; | |
} | |
type APIResponse = { |
'use strict'; | |
/** @type {import('sequelize-cli').Migration} */ | |
module.exports = { | |
async up(queryInterface, Sequelize) { | |
await queryInterface.bulkInsert( | |
"localidade", | |
[ | |
{ | |
nome_localidade: "Localidade 10", |
'use strict'; | |
/** @type {import('sequelize-cli').Migration} */ | |
module.exports = { | |
async up(queryInterface, Sequelize) { | |
await queryInterface.bulkInsert( | |
"locais", | |
[ | |
{ | |
usuario_id: 9, |
'use strict'; | |
/** @type {import('sequelize-cli').Migration} */ | |
module.exports = { | |
async up(queryInterface, Sequelize) { | |
await queryInterface.bulkInsert( | |
"usuario", | |
[ | |
{ | |
nome_completo: 'Java', |
[user] | |
name = seunomeaqui | |
email = [email protected] | |
[core] | |
editor = notepad | |
[merge] | |
tool = meld | |
keepBackup = false | |
[mergetool] | |
keepBackup = false |
window.onload = function() { | |
console.log("carregando arquivo..."); | |
var canvas = document.getElementById("canvas"); | |
var boneco = document.getElementById("boneco"); | |
var ctx = canvas ? canvas.getContext("2d") : null; | |
var bonecoCoord = { | |
x: 25, | |
y: 200 | |
} |
var charactersList = document.getElementById('charactersList'); | |
var searchBar = document.getElementById('searchBar'); | |
var hpCharacters = []; | |
/* código novo */ | |
function pesquisar() { | |
var termosDaBusca = document.getElementById("searchBar").value; | |
var filteredCharacters = hpCharacters.filter((character) => { | |
return ( | |
character.body.toLowerCase().includes(termosDaBusca) || |