Generation

generate functionSun, 30 Jul 2023

crea una funcion con reactJs para que al hacer click en un objeto se abra una nueva pesaña con un elemento de una carpeta interna de virtual studio code

const createFunction = () => { return () => { const h1 = document.createElement('h1'); h1.textContent = "Hello World"; document.body.appendChild(h1); } } const counter = (state = 0, action) => { if(action.type === 'INCREMENT') { return state + 1; } else if(action.type === 'DECREMENT') { return state - 1; } else { return state; } } // redux const { createStore } = Redux; const store = createStore(counter); store.subscribe(() => { console.log(store.getState()); }); store.dispatch({ type: 'INCREMENT' }); store.dispatch({ type: 'INCREMENT' }); store.dispatch({ type: 'DECREMENT' });

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant